removed compiler warnings,
removed debug outputs.
[r5701]
# Project: libFIRM
# File name: firmjni/Makefile.in
# Purpose:
# Project: libFIRM
# File name: firmjni/Makefile.in
# Purpose:
/*
* Define some convenience macros using the predefined hash function.
*/
/*
* Define some convenience macros using the predefined hash function.
*/
-#define pset_insert_ptr(set,key) pset_insert(set, key, HASH_PTR(key))
+#define pset_insert_ptr(set,key) pset_insert(set, key, HASH_PTR(key))
#define pset_hinsert_ptr(set,key) pset_hinsert(set, key, HASH_PTR(key))
#define pset_hinsert_ptr(set,key) pset_hinsert(set, key, HASH_PTR(key))
-#define pset_remove_ptr(set,key) pset_remove(set, key, HASH_PTR(key))
-#define pset_find_ptr(set,key) pset_find(set, key, HASH_PTR(key))
-#define pset_new_ptr(slots) new_pset(pset_default_ptr_cmp, slots)
-#define pset_new_ptr_default() pset_new_ptr(64)
-void pset_insert_pset_ptr(pset *target, pset *src); /* Insertss all elements of src in target. */
+#define pset_remove_ptr(set,key) pset_remove(set, key, HASH_PTR(key))
+#define pset_find_ptr(set,key) pset_find(set, key, HASH_PTR(key))
+#define pset_new_ptr(slots) new_pset(pset_default_ptr_cmp, slots)
+#define pset_new_ptr_default() pset_new_ptr(64)
+void pset_insert_pset_ptr(pset *target, pset *src); /* Inserts all elements of src in target. */
/** The entry of a pset, representing an element pointer in the set and it's meta-information */
/** The entry of a pset, representing an element pointer in the set and it's meta-information */
* The core algorithm. *
*-----------------------------------------------------------*/
* The core algorithm. *
*-----------------------------------------------------------*/
static void scc (ir_node *n) {
int i;
if (irn_visited(n)) return;
static void scc (ir_node *n) {
int i;
if (irn_visited(n)) return;
#include "entity.h"
#include "irnode.h"
#include "entity.h"
#include "irnode.h"
+/*-----------------------------------------------------------------*/
+/* Accessing the trout datastructures. */
+/* These routines only work properly if firm is in state */
+/* trouts_consistent or trouts_inconsistent. */
+/*-----------------------------------------------------------------*/
-/*------------------------------------------------------------------*/
-/* Accessing the trout datastructures. */
-/* These routines only work properly if firm is in state */
-/* trouts_consistent or trouts_inconsistent. */
-/*------------------------------------------------------------------*/
-
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+/* entities */
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/** Number of Load/Store nodes that possibly access this entity. */
int get_entity_n_accesses(entity *ent);
/** Load/Store node that possibly access this entity. */
ir_node *get_entity_access(entity *ent, int pos);
/** Number of Load/Store nodes that possibly access this entity. */
int get_entity_n_accesses(entity *ent);
/** Load/Store node that possibly access this entity. */
ir_node *get_entity_access(entity *ent, int pos);
/** Number of references to an entity, in form of SymConst/Sel.
* Including references from constant entities and the like. */
int get_entity_n_references(entity *ent);
/** Number of references to an entity, in form of SymConst/Sel.
* Including references from constant entities and the like. */
int get_entity_n_references(entity *ent);
* Including references from constants. */
ir_node *get_entity_reference(entity *ent, int pos);
* Including references from constants. */
ir_node *get_entity_reference(entity *ent, int pos);
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+/* types */
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/** Number of Alloc nodes that create an instance of this type. */
int get_type_n_allocs(type *tp);
/** Number of Alloc nodes that create an instance of this type. */
int get_type_n_allocs(type *tp);
int get_class_n_downcasts(type *clss);
/* Access all pointer types that point to tp. */
int get_class_n_downcasts(type *clss);
/* Access all pointer types that point to tp. */
-int get_type_n_pointertypes_to(type *tp);
+int get_type_n_pointertypes_to(type *tp);
type *get_type_pointertype_to(type *tp, int pos);
type *get_type_pointertype_to(type *tp, int pos);
+/* @@@ TODO: compute all entities that use a type. */
/*------------------------------------------------------------------*/
/* Building and Removing the trout datastructure */
/*------------------------------------------------------------------*/
/* Building and Removing the trout datastructure */
/** The state of the tr_out datastructure.
*
/** The state of the tr_out datastructure.
*
- * We reuse the enum of irouts. */
+ * We reuse the enum of irouts.
+ * @see irouts.h. */
irg_outs_state get_trouts_state(void);
void set_trouts_inconsistent(void);
irg_outs_state get_trouts_state(void);
void set_trouts_inconsistent(void);
* type --> entity of this type. @@@ to be implemented.
*
* Sets trout state to outs_consistent.
* type --> entity of this type. @@@ to be implemented.
*
* Sets trout state to outs_consistent.
- *
- * @todo @@@ We need a flag that signs the consistency of the out information. */
void compute_trouts(void);
/** Free trout data. */
void compute_trouts(void);
/** Free trout data. */
*/
typedef enum {
ip_view_no, /**< The interprocedural view is not constructed. There are no
*/
typedef enum {
ip_view_no, /**< The interprocedural view is not constructed. There are no
- view specific nodes (EndReg, Filter....) in any graph. */
+ view specific nodes (EndReg, Filter, Break ...) in any graph. */
ip_view_valid, /**< The interprocedural view is valid. */
ip_view_invalid /**< The interprocedural view is invalid. Specific nodes are
all still in the representation, but the graph is no more complete. */
ip_view_valid, /**< The interprocedural view is valid. */
ip_view_invalid /**< The interprocedural view is invalid. Specific nodes are
all still in the representation, but the graph is no more complete. */
/** Output the firm kind of the node */
#define DDMK(X) printf("%s(l.%i) %s: %p\n", __MYFUNC__, __LINE__, print_firm_kind(X), (void *)(X));
/** Output information about a node */
/** Output the firm kind of the node */
#define DDMK(X) printf("%s(l.%i) %s: %p\n", __MYFUNC__, __LINE__, print_firm_kind(X), (void *)(X));
/** Output information about a node */
-#define DDMN(X) printf("%s(l.%i) %s%s: %ld (%p)\n", __MYFUNC__, __LINE__, get_irn_opname(X), get_mode_name(get_irn_mode(X)), get_irn_node_nr(X), (void *)(X))
+
+/*#define DDMN(X) printf("%s(l.%i) %s%s: %ld (%p)\n", __MYFUNC__, __LINE__, get_irn_opname(X), get_mode_name(get_irn_mode(X)), get_irn_node_nr(X), (void *)(X))*/
+int dump_node_opcode(FILE *F, ir_node *n);
+#define DDMN(X) do { printf("%s(l.%i) ", __MYFUNC__, __LINE__); dump_node_opcode(stdout, X); printf(": %ld (%p)\n", get_irn_node_nr(X), (void *)(X)); } while (0)
+
/** Output information about a node and its block */
#define DDMNB(X) printf("%s%s: %ld (in block %ld)\n", get_irn_opname(X), get_mode_name(get_irn_mode(X)), get_irn_node_nr(X), get_irn_node_nr(get_nodes_block(X)))
/** Output information about a type */
/** Output information about a node and its block */
#define DDMNB(X) printf("%s%s: %ld (in block %ld)\n", get_irn_opname(X), get_mode_name(get_irn_mode(X)), get_irn_node_nr(X), get_irn_node_nr(get_nodes_block(X)))
/** Output information about a type */
/**
* Optimize function calls by handling real functions.
*
/**
* Optimize function calls by handling real functions.
*
- * This optimization first detects all "real fucntions", ie
+ * This optimization first detects all "real functions", i.e.,
* IR graphs that neither read nor write memory (and hence did
* not create exceptions, as these use memory in Firm).
*
* The result of calls to such functions depends only on its
* IR graphs that neither read nor write memory (and hence did
* not create exceptions, as these use memory in Firm).
*
* The result of calls to such functions depends only on its
- * arguments, hence those calls are not anymore pinned.
+ * arguments, hence those calls are no more pinned.
*
* This is a rather strong criteria, so do not expect that a
* lot of functions will be found. Moreover, all of them might
* already be inlined if inlining is activated.
* Anyway, it might be good for handling builtin's or pseudo-graphs,
* even if the later read/write memory (but we know how).
*
* This is a rather strong criteria, so do not expect that a
* lot of functions will be found. Moreover, all of them might
* already be inlined if inlining is activated.
* Anyway, it might be good for handling builtin's or pseudo-graphs,
* even if the later read/write memory (but we know how).
+ *
+ * If callee information is valid, we also optimize polymorphic Calls.
*/
void optimize_funccalls(void);
*/
void optimize_funccalls(void);
if (get_irn_op(ptr) == op_SymConst) {
assert(get_SymConst_kind(ptr) == symconst_addr_ent);
root = get_SymConst_entity(ptr);
if (get_irn_op(ptr) == op_SymConst) {
assert(get_SymConst_kind(ptr) == symconst_addr_ent);
root = get_SymConst_entity(ptr);
- res = depth == 0 ? NULL : new_compound_graph_path(get_entity_type(root), depth);
+ res = (depth == 0) ? NULL : new_compound_graph_path(get_entity_type(root), depth);
}
else {
assert(get_irn_op(ptr) == op_Sel);
}
else {
assert(get_irn_op(ptr) == op_Sel);
}
else if (variability_constant == get_entity_variability(ent)) {
compound_graph_path *path;
}
else if (variability_constant == get_entity_variability(ent)) {
compound_graph_path *path;
printf(">>>>>>>>>>>>> Found access to constant entity %s in function %s\n", get_entity_name(ent),
get_entity_name(get_irg_entity(current_ir_graph)));
printf(" load: "); DDMN(load);
printf(" ptr: "); DDMN(ptr);
printf(">>>>>>>>>>>>> Found access to constant entity %s in function %s\n", get_entity_name(ent),
get_entity_name(get_irg_entity(current_ir_graph)));
printf(" load: "); DDMN(load);
printf(" ptr: "); DDMN(ptr);
path = get_accessed_path(ptr);
if (path) {
ir_node *c;
path = get_accessed_path(ptr);
if (path) {
ir_node *c;
assert(is_proper_compound_graph_path(path, get_compound_graph_path_length(path)-1));
c = get_compound_ent_value_by_path(ent, path);
assert(is_proper_compound_graph_path(path, get_compound_graph_path_length(path)-1));
c = get_compound_ent_value_by_path(ent, path);
- printf(" cons: "); DDMN(c);
+ /* printf(" cons: "); DDMN(c); */
if (info->projs[pn_Load_M])
exchange(info->projs[pn_Load_M], mem);
if (info->projs[pn_Load_res])
exchange(info->projs[pn_Load_res], copy_const_value(c));
if (info->projs[pn_Load_M])
exchange(info->projs[pn_Load_M], mem);
if (info->projs[pn_Load_res])
exchange(info->projs[pn_Load_res], copy_const_value(c));
{
int j;
for (j = 0; j < get_compound_graph_path_length(path); ++j) {
{
int j;
for (j = 0; j < get_compound_graph_path_length(path); ++j) {
+ */
+ } else {
+ /* We can not determine a correct access path. E.g., in jack, we load
+ a byte from an object to generate an exception. Happens in test program
+ Reflectiontest.
+ printf(">>>>>>>>>>>>> Found access to constant entity %s in function %s\n", get_entity_name(ent),
+ get_entity_name(get_irg_entity(current_ir_graph)));
+ printf(" load: "); DDMN(load);
+ printf(" ptr: "); DDMN(ptr);
+ if (get_irn_op(ptr) == op_SymConst &&
+ get_SymConst_kind(ptr) == symconst_addr_ent) { printf(" "); DDMEO(get_SymConst_entity(ptr)); }
printf("cannot optimize.\n");
printf("cannot optimize.\n");
}
/* we changed the irg, but try further */
}
/* we changed the irg, but try further */
- fprintf(dmp->f, "\nEntity %s, Irg %p", get_entity_name(entry->ent), (void *)entry->irg);
+ fprintf(dmp->f, "\nEntity %s, Irg %p", get_entity_ld_name(entry->ent), (void *)entry->irg);
else
fprintf(dmp->f, "\nIrg %p", (void *)entry->irg);
}
else
fprintf(dmp->f, "\nIrg %p", (void *)entry->irg);
}