mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-15 13:55:07 +00:00
OK, finally, everything should be back in order.
This commit is contained in:
@@ -69,7 +69,7 @@ tag_switch__generate(Cases, Var, CodeModel, CanFail, EndLabel, Code) -->
|
||||
{ tag_switch__group_tags(Cases, TagCaseMap0, TagCaseMap) },
|
||||
{ tag_switch__order_tags(TagCountList, TagCaseMap, TagCaseList) },
|
||||
|
||||
code_info__get_next_label(FailLabel, no),
|
||||
code_info__get_next_label(FailLabel),
|
||||
code_info__produce_variable(Var, VarCode, Rval),
|
||||
tag_switch__generate_primary_tag_codes(TagCaseList, Var, Rval,
|
||||
CodeModel, CanFail, EndLabel, FailLabel, TagCountMap, CasesCode),
|
||||
@@ -114,7 +114,7 @@ tag_switch__generate_primary_tag_codes([TagGroup | TagGroups], Var, Rval,
|
||||
{ TagGroups = [_|_] ; CanFail = can_fail }
|
||||
->
|
||||
code_info__grab_code_info(CodeInfo),
|
||||
code_info__get_next_label(ElseLabel, no),
|
||||
code_info__get_next_label(ElseLabel),
|
||||
% XXX may be able to dispense with the tag operation
|
||||
{ TestRval = binop(ne, unop(tag, Rval),
|
||||
unop(mktag, const(int_const(Primary)))) },
|
||||
@@ -197,7 +197,7 @@ tag_switch__generate_secondary_tag_tests([Case0 | Cases0], Rval, Primary,
|
||||
{ Case0 = Secondary - Goal },
|
||||
( { Cases0 = [_|_] ; CodeModel = model_semi } ->
|
||||
code_info__grab_code_info(CodeInfo),
|
||||
code_info__get_next_label(ElseLabel, no),
|
||||
code_info__get_next_label(ElseLabel),
|
||||
{ StagLoc = remote ->
|
||||
TestCode = node([if_val(binop(ne,
|
||||
lval(field(Primary, Rval, const(int_const(0)))),
|
||||
@@ -248,7 +248,7 @@ tag_switch__generate_secondary_tag_codes(CaseList, CurSecondary, MaxSecondary,
|
||||
;
|
||||
{ NextSecondary is CurSecondary + 1 },
|
||||
( { CaseList = [CurSecondary - Goal | CaseList1] } ->
|
||||
code_info__get_next_label(NewLabel, no),
|
||||
code_info__get_next_label(NewLabel),
|
||||
( { CaseList1 = [] } ->
|
||||
code_gen__generate_forced_goal(CodeModel, Goal, GoalCode)
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user