From d9712f5d7dee23289ce944471dd167b888603c2c Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 13 Mar 2018 20:56:53 -0700 Subject: [PATCH] Elaborate on some comments in generated source files. Recipe names are fairly obscure, so the more context we can give when using them the better. --- lib/cretonne/meta/gen_binemit.py | 2 +- lib/cretonne/meta/gen_encoding.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cretonne/meta/gen_binemit.py b/lib/cretonne/meta/gen_binemit.py index c3d1b18e86..5888d89e10 100644 --- a/lib/cretonne/meta/gen_binemit.py +++ b/lib/cretonne/meta/gen_binemit.py @@ -152,7 +152,7 @@ def gen_isa(isa, fmt): fmt.line('let bits = encoding.bits();') with fmt.indented('match func.encodings[inst].recipe() {', '}'): for i, recipe in enumerate(isa.all_recipes): - fmt.comment(recipe.name) + fmt.comment('Recipe {}'.format(recipe.name)) with fmt.indented('{} => {{'.format(i), '}'): gen_recipe(recipe, fmt) fmt.line('_ => {},') diff --git a/lib/cretonne/meta/gen_encoding.py b/lib/cretonne/meta/gen_encoding.py index 46fe22a913..da382a1774 100644 --- a/lib/cretonne/meta/gen_encoding.py +++ b/lib/cretonne/meta/gen_encoding.py @@ -756,7 +756,7 @@ def emit_recipe_constraints(isa, fmt): 'static RECIPE_CONSTRAINTS: [RecipeConstraints; {}] = [' .format(len(isa.all_recipes)), '];'): for r in isa.all_recipes: - fmt.comment(r.name) + fmt.comment('Constraints for recipe {}:'.format(r.name)) tied_i2o, tied_o2i = r.ties() fixed_ins, fixed_outs = r.fixed_ops() with fmt.indented('RecipeConstraints {', '},'): @@ -830,7 +830,7 @@ def emit_recipe_sizing(isa, fmt): 'static RECIPE_SIZING: [RecipeSizing; {}] = [' .format(len(isa.all_recipes)), '];'): for r in isa.all_recipes: - fmt.comment(r.name) + fmt.comment('Code size information for recipe {}:'.format(r.name)) with fmt.indented('RecipeSizing {', '},'): fmt.format('bytes: {},', r.size) if r.branch_range: