(left->get_high ()), wi::one (TYPE_PRECISION (type))))
{
left->set_high (right->get_high ());
+ delete right;
continue;
}
}
= jump_table_cluster::find_jump_tables (filtered_clusters);
bool r = output.length () < filtered_clusters.length ();
if (r)
- dump_clusters (&output, "JT can be built");
- output.release ();
- if (r)
- return true;
+ {
+ dump_clusters (&output, "JT can be built");
+ release_clusters (output);
+ return true;
+ }
+ else
+ output.release ();
output = bit_test_cluster::find_bit_tests (filtered_clusters);
r = output.length () < filtered_clusters.length ();
if (r)
dump_clusters (&output, "BT can be built");
- for (unsigned i = 0; i < output.length (); i++)
- delete output[i];
-
- output.release ();
+ release_clusters (output);
return r;
}
output.release ();
bool expanded = try_switch_expansion (output2);
-
- for (unsigned i = 0; i < output2.length (); i++)
- delete output2[i];
-
- output2.release ();
-
+ release_clusters (output2);
return expanded;
}
{
return new pass_lower_switch<false> (ctxt);
}
-
-
e->aux = (void *) 0;
}
+/* Release CLUSTERS vector and destruct all dynamically allocated items. */
+
+static inline void
+release_clusters (vec<cluster *> &clusters)
+{
+ for (unsigned i = 0; i < clusters.length (); i++)
+ delete clusters[i];
+ clusters.release ();
+}
+
} // tree_switch_conversion namespace
#endif // TREE_SWITCH_CONVERSION_H