+/**
+ * Checks if a graph allocates new memory and returns the
+ * type of the newly allocated entity.
+ * Returns NULL if the graph did not represent an Allocation.
+ *
+ * The default implementation hecks for Alloc nodes only.
+ */
+ir_type *default_firm_get_Alloc(ir_node *n) {
+ n = skip_Proj(n);
+ if (get_irn_op(n) == op_Alloc) {
+ return get_Alloc_type(n);
+ }
+ return NULL;
+}
+
+typedef ir_type *(*get_Alloc_func)(ir_node *n);
+
+/** The get_Alloc function */
+static get_Alloc_func firm_get_Alloc = default_firm_get_Alloc;
+
+/** Set a new get_Alloc_func and returns the old one. */
+get_Alloc_func firm_set_Alloc_func(get_Alloc_func newf) {
+ get_Alloc_func old = firm_get_Alloc;
+ firm_get_Alloc = newf;
+ return old;
+}
+