From 32d4af5458a97152f19b97af664cf22599e1b3fd Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 7 Sep 2016 11:12:48 -0700 Subject: 3304 Highlight a couple of places where it turns out that we're flying by the seat of our pants with heuristics, and we don't really understand how to precompute metadata for a program's types. --- 030container.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '030container.cc') diff --git a/030container.cc b/030container.cc index ac78a103..a1499a8b 100644 --- a/030container.cc +++ b/030container.cc @@ -165,8 +165,7 @@ if (t.kind == CONTAINER) { //: precompute Container_metadata before we need size_of //: also store a copy in each reagent in each instruction in each recipe -//: does unnecessary work for meaningless types -//: e.g. (address number) also computes size of 'address' +//: sometimes does unnecessary work for meaningless types :(after "Begin Instruction Modifying Transforms") // needs to happen before transform_names, therefore after Type Modifying Transforms below Transform.push_back(compute_container_sizes); @@ -197,7 +196,8 @@ void compute_container_sizes(const type_tree* type, set& pending_m if (contains_key(pending_metadata, type->value)) return; if (type->value) pending_metadata.insert(type->value); if (contains_key(Container_metadata, type)) return; - if (type->left) compute_container_sizes(type->left, pending_metadata); + // might be needed by later layers, but we haven't found a need for it yet +//? if (type->left) compute_container_sizes(type->left, pending_metadata); if (type->right) compute_container_sizes(type->right, pending_metadata); if (!contains_key(Type, type->value)) return; // error raised elsewhere type_info& info = get(Type, type->value); -- cgit 1.4.1-2-gfad0