diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-10-29 17:15:09 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-10-29 17:15:09 -0700 |
commit | e6692482643dc007988188e2b19fbb9219ca2833 (patch) | |
tree | cbb805cba3bd46dfc7d71adaa2150d9acb5cc5ba /041jump_target.cc | |
parent | 5a702544a6f8aa3fa520ba387a6c0e803e076476 (diff) | |
download | mu-e6692482643dc007988188e2b19fbb9219ca2833.tar.gz |
2321 - more preparations for static dispatch
Deduce operation id from name during transform rather than load, so that earlier transforms have a chance to modify the name.
Diffstat (limited to '041jump_target.cc')
-rw-r--r-- | 041jump_target.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/041jump_target.cc b/041jump_target.cc index 7207c799..1f0e2212 100644 --- a/041jump_target.cc +++ b/041jump_target.cc @@ -39,18 +39,18 @@ void transform_labels(const recipe_ordinal r) { } for (long long int i = 0; i < SIZE(Recipe[r].steps); ++i) { instruction& inst = Recipe[r].steps.at(i); - if (inst.operation == Recipe_ordinal["jump"]) { + if (inst.name == "jump") { replace_offset(inst.ingredients.at(0), offset, i, r); } - if (inst.operation == Recipe_ordinal["jump-if"] || inst.operation == Recipe_ordinal["jump-unless"]) { + if (inst.name == "jump-if" || inst.name == "jump-unless") { replace_offset(inst.ingredients.at(1), offset, i, r); } - if ((inst.operation == Recipe_ordinal["loop"] || inst.operation == Recipe_ordinal["break"]) + if ((inst.name == "loop" || inst.name == "break") && SIZE(inst.ingredients) == 1) { replace_offset(inst.ingredients.at(0), offset, i, r); } - if ((inst.operation == Recipe_ordinal["loop-if"] || inst.operation == Recipe_ordinal["loop-unless"] - || inst.operation == Recipe_ordinal["break-if"] || inst.operation == Recipe_ordinal["break-unless"]) + if ((inst.name == "loop-if" || inst.name == "loop-unless" + || inst.name == "break-if" || inst.name == "break-unless") && SIZE(inst.ingredients) == 2) { replace_offset(inst.ingredients.at(1), offset, i, r); } |