From d059fe743df6a5e8a72fc1418f2c3ba1ed5ac1e6 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 20 Oct 2016 00:37:24 -0700 Subject: 3524 --- html/054static_dispatch.cc.html | 50 ++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'html/054static_dispatch.cc.html') diff --git a/html/054static_dispatch.cc.html b/html/054static_dispatch.cc.html index 2e0c7318..32548869 100644 --- a/html/054static_dispatch.cc.html +++ b/html/054static_dispatch.cc.html @@ -92,7 +92,7 @@ Recipe_variants = Recipe_variants_snapshot; :(code) string matching_variant_name(const recipe& rr) { const vector<recipe_ordinal>& variants = get_or_insert(Recipe_variants, rr.name); - for (int i = 0; i < SIZE(variants); ++i) { + for (int i = 0; i < SIZE(variants); ++i) { if (!contains_key(Recipe, variants.at(i))) continue; const recipe& candidate = get(Recipe, variants.at(i)); if (!all_reagents_match(rr, candidate)) continue; @@ -104,13 +104,13 @@ string matching_variant_name(bool all_reagents_match(const recipe& r1, const recipe& r2) { if (SIZE(r1.ingredients) != SIZE(r2.ingredients)) return false; if (SIZE(r1.products) != SIZE(r2.products)) return false; - for (int i = 0; i < SIZE(r1.ingredients); ++i) { + for (int i = 0; i < SIZE(r1.ingredients); ++i) { expand_type_abbreviations(r1.ingredients.at(i).type); expand_type_abbreviations(r2.ingredients.at(i).type); if (!deeply_equal_type_names(r1.ingredients.at(i), r2.ingredients.at(i))) return false; } - for (int i = 0; i < SIZE(r1.products); ++i) { + for (int i = 0; i < SIZE(r1.products); ++i) { expand_type_abbreviations(r1.products.at(i).type); expand_type_abbreviations(r2.products.at(i).type); if (!deeply_equal_type_names(r1.products.at(i), r2.products.at(i))) @@ -143,7 +143,7 @@ Literal_type_names.insert } string next_unused_recipe_name(const string& recipe_name) { - for (int i = 2; ; ++i) { + for (int i = 2; /*forever*/; ++i) { ostringstream out; out << recipe_name << '_' << i; if (!contains_key(Recipe_ordinal, out.str())) @@ -168,9 +168,9 @@ string next_unused_recipe_name(//: support recipe headers in a previous transform to fill in missing types :(before "End check_or_set_invalid_types") -for (int i = 0; i < SIZE(caller.ingredients); ++i) +for (int i = 0; i < SIZE(caller.ingredients); ++i) check_or_set_invalid_types(caller.ingredients.at(i).type, maybe(caller.name), "recipe header ingredient"); -for (int i = 0; i < SIZE(caller.products); ++i) +for (int i = 0; i < SIZE(caller.products); ++i) check_or_set_invalid_types(caller.products.at(i).type, maybe(caller.name), "recipe header product"); //: after filling in all missing types (because we'll be introducing 'blank' types in this transform in a later layer, for shape-shifting recipes) @@ -190,7 +190,7 @@ list<call> resolve_stack; void resolve_ambiguous_calls(recipe_ordinal r) { recipe& caller_recipe = get(Recipe, r); trace(9991, "transform") << "--- resolve ambiguous calls for recipe " << caller_recipe.name << end(); - for (int index = 0; index < SIZE(caller_recipe.steps); ++index) { + for (int index = 0; index < SIZE(caller_recipe.steps); ++index) { instruction& inst = caller_recipe.steps.at(index); if (inst.is_label) continue; if (non_ghost_size(get_or_insert(Recipe_variants, inst.name)) == 0) continue; @@ -233,7 +233,7 @@ string best_variant(instruction& inst// error messages if (get(Recipe_ordinal, inst.name) >= MAX_PRIMITIVE_RECIPES) { // we currently don't check types for primitive variants raise << maybe(caller_recipe.name) << "failed to find a matching call for '" << inst.original_string << "'\n" << end(); - for (list<call>::iterator p = /*skip*/++resolve_stack.begin(); p != resolve_stack.end(); ++p) { + for (list<call>::iterator p = /*skip*/++resolve_stack.begin(); p != resolve_stack.end(); ++p) { const recipe& specializer_recipe = get(Recipe, p->running_recipe); const instruction& specializer_inst = specializer_recipe.steps.at(p->running_step_index); if (specializer_recipe.name != "interactive") @@ -258,7 +258,7 @@ string best_variant(instruction& inst// phase 1 vector<recipe_ordinal> strictly_matching_variants(const instruction& inst, vector<recipe_ordinal>& variants) { vector<recipe_ordinal> result; - for (int i = 0; i < SIZE(variants); ++i) { + for (int i = 0; i < SIZE(variants); ++i) { if (variants.at(i) == -1) continue; trace(9992, "transform") << "checking variant (strict) " << i << ": " << header_label(variants.at(i)) << end(); if (all_header_reagents_strictly_match(inst, get(Recipe, variants.at(i)))) @@ -268,13 +268,13 @@ vector<recipe_ordinal> strictly_matching_variants( } bool all_header_reagents_strictly_match(const instruction& inst, const recipe& variant) { - for (int i = 0; i < min(SIZE(inst.ingredients), SIZE(variant.ingredients)); ++i) { + for (int i = 0; i < min(SIZE(inst.ingredients), SIZE(variant.ingredients)); ++i) { if (!types_strictly_match(variant.ingredients.at(i), inst.ingredients.at(i))) { trace(9993, "transform") << "strict match failed: ingredient " << i << end(); return false; } } - for (int i = 0; i < min(SIZE(inst.products), SIZE(variant.products)); ++i) { + for (int i = 0; i < min(SIZE(inst.products), SIZE(variant.products)); ++i) { if (is_dummy(inst.products.at(i))) continue; if (!types_strictly_match(variant.products.at(i), inst.products.at(i))) { trace(9993, "transform") << "strict match failed: product " << i << end(); @@ -287,7 +287,7 @@ vector<recipe_ordinal> strictly_matching_variants( // phase 2 vector<recipe_ordinal> strictly_matching_variants_except_literal_zero_against_address(const instruction& inst, vector<recipe_ordinal>& variants) { vector<recipe_ordinal> result; - for (int i = 0; i < SIZE(variants); ++i) { + for (int i = 0; i < SIZE(variants); ++i) { if (variants.at(i) == -1) continue; trace(9992, "transform") << "checking variant (strict except literal-zero-against-address) " << i << ": " << header_label(variants.at(i)) << end(); if (all_header_reagents_strictly_match_except_literal_zero_against_address(inst, get(Recipe, variants.at(i)))) @@ -297,13 +297,13 @@ vector<recipe_ordinal> strictly_matching_variants_except_literal_zero_agai } bool all_header_reagents_strictly_match_except_literal_zero_against_address(const instruction& inst, const recipe& variant) { - for (int i = 0; i < min(SIZE(inst.ingredients), SIZE(variant.ingredients)); ++i) { + for (int i = 0; i < min(SIZE(inst.ingredients), SIZE(variant.ingredients)); ++i) { if (!types_strictly_match_except_literal_zero_against_address(variant.ingredients.at(i), inst.ingredients.at(i))) { trace(9993, "transform") << "match failed: ingredient " << i << end(); return false; } } - for (int i = 0; i < min(SIZE(inst.products), SIZE(variant.products)); ++i) { + for (int i = 0; i < min(SIZE(inst.products), SIZE(variant.products)); ++i) { if (is_dummy(inst.products.at(i))) continue; if (!types_strictly_match(variant.products.at(i), inst.products.at(i))) { trace(9993, "transform") << "match failed: product " << i << end(); @@ -322,7 +322,7 @@ vector<recipe_ordinal> strictly_matching_variants_except_literal_zero_agai // phase 4 vector<recipe_ordinal> strictly_matching_variants_except_literal_against_address_or_boolean(const instruction& inst, vector<recipe_ordinal>& variants) { vector<recipe_ordinal> result; - for (int i = 0; i < SIZE(variants); ++i) { + for (int i = 0; i < SIZE(variants); ++i) { if (variants.at(i) == -1) continue; trace(9992, "transform") << "checking variant (strict except literal-against-boolean) " << i << ": " << header_label(variants.at(i)) << end(); if (all_header_reagents_strictly_match_except_literal_against_address_or_boolean(inst, get(Recipe, variants.at(i)))) @@ -332,13 +332,13 @@ vector<recipe_ordinal> strictly_matching_variants_except_literal_against_a } bool all_header_reagents_strictly_match_except_literal_against_address_or_boolean(const instruction& inst, const recipe& variant) { - for (int i = 0; i < min(SIZE(inst.ingredients), SIZE(variant.ingredients)); ++i) { + for (int i = 0; i < min(SIZE(inst.ingredients), SIZE(variant.ingredients)); ++i) { if (!types_strictly_match_except_literal_against_address_or_boolean(variant.ingredients.at(i), inst.ingredients.at(i))) { trace(9993, "transform") << "match failed: ingredient " << i << end(); return false; } } - for (int i = 0; i < min(SIZE(variant.products), SIZE(inst.products)); ++i) { + for (int i = 0; i < min(SIZE(variant.products), SIZE(inst.products)); ++i) { if (is_dummy(inst.products.at(i))) continue; if (!types_strictly_match_except_literal_against_address_or_boolean(variant.products.at(i), inst.products.at(i))) { trace(9993, "transform") << "match failed: product " << i << end(); @@ -357,7 +357,7 @@ vector<recipe_ordinal> strictly_matching_variants_except_literal_against_a // phase 5 vector<recipe_ordinal> matching_variants(const instruction& inst, vector<recipe_ordinal>& variants) { vector<recipe_ordinal> result; - for (int i = 0; i < SIZE(variants); ++i) { + for (int i = 0; i < SIZE(variants); ++i) { if (variants.at(i) == -1) continue; trace(9992, "transform") << "checking variant " << i << ": " << header_label(variants.at(i)) << end(); if (all_header_reagents_match(inst, get(Recipe, variants.at(i)))) @@ -367,13 +367,13 @@ vector<recipe_ordinal> matching_variants(} bool all_header_reagents_match(const instruction& inst, const recipe& variant) { - for (int i = 0; i < min(SIZE(inst.ingredients), SIZE(variant.ingredients)); ++i) { + for (int i = 0; i < min(SIZE(inst.ingredients), SIZE(variant.ingredients)); ++i) { if (!types_match(variant.ingredients.at(i), inst.ingredients.at(i))) { trace(9993, "transform") << "match failed: ingredient " << i << end(); return false; } } - for (int i = 0; i < min(SIZE(variant.products), SIZE(inst.products)); ++i) { + for (int i = 0; i < min(SIZE(variant.products), SIZE(inst.products)); ++i) { if (is_dummy(inst.products.at(i))) continue; if (!types_match(variant.products.at(i), inst.products.at(i))) { trace(9993, "transform") << "match failed: product " << i << end(); @@ -388,7 +388,7 @@ vector<recipe_ordinal> matching_variants((!candidates.empty()); int min_score = 999; int min_index = 0; - for (int i = 0; i < SIZE(candidates); ++i) { + for (int i = 0; i < SIZE(candidates); ++i) { const recipe& candidate = get(Recipe, candidates.at(i)); int score = abs(SIZE(candidate.products)-SIZE(inst.products)) + abs(SIZE(candidate.ingredients)-SIZE(inst.ingredients)); @@ -403,7 +403,7 @@ vector<recipe_ordinal> matching_variants(int non_ghost_size(vector<recipe_ordinal>& variants) { int result = 0; - for (int i = 0; i < SIZE(variants); ++i) + for (int i = 0; i < SIZE(variants); ++i) if (variants.at(i) != -1) ++result; return result; } @@ -411,7 +411,7 @@ vector<recipe_ordinal> matching_variants(bool next_stash(const call& c, instruction* stash_inst) { const recipe& specializer_recipe = get(Recipe, c.running_recipe); int index = c.running_step_index; - for (++index; index < SIZE(specializer_recipe.steps); ++index) { + for (++index; index < SIZE(specializer_recipe.steps); ++index) { const instruction& inst = specializer_recipe.steps.at(index); if (inst.name == "stash") { *stash_inst = inst; @@ -601,10 +601,10 @@ string header_label(recipe_ordinal r(const recipe& caller) { ostringstream out; out << "recipe " << caller.name; - for (int i = 0; i < SIZE(caller.ingredients); ++i) + for (int i = 0; i < SIZE(caller.ingredients); ++i) out << ' ' << to_string(caller.ingredients.at(i)); if (!caller.products.empty()) out << " ->"; - for (int i = 0; i < SIZE(caller.products); ++i) + for (int i = 0; i < SIZE(caller.products); ++i) out << ' ' << to_string(caller.products.at(i)); return out.str(); } -- cgit 1.4.1-2-gfad0