Commit 63eda4e1 authored by Götz Lindenmaier's avatar Götz Lindenmaier
Browse files

Changed comments,

removed compiler warnings,
removed debug outputs.

[r5701]
parent 117757dc
#
# Project: libFIRM
# File name: firmjni/Makefile.in
# Purpose:
......
......@@ -39,13 +39,13 @@ typedef struct pset pset;
/*
* 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_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 */
......
......@@ -916,7 +916,6 @@ is_outermost_loop(ir_loop *l) {
* The core algorithm. *
*-----------------------------------------------------------*/
static void scc (ir_node *n) {
int i;
if (irn_visited(n)) return;
......
......@@ -35,20 +35,21 @@
#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 references to an entity, in form of SymConst/Sel.
* Including references from constant entities and the like. */
int get_entity_n_references(entity *ent);
......@@ -56,6 +57,9 @@ int get_entity_n_references(entity *ent);
* 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);
......@@ -72,9 +76,10 @@ int get_class_n_upcasts(type *clss);
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);
/* @@@ TODO: compute all entities that use a type. */
/*------------------------------------------------------------------*/
/* Building and Removing the trout datastructure */
......@@ -82,7 +87,8 @@ type *get_type_pointertype_to(type *tp, int pos);
/** 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);
......@@ -107,8 +113,7 @@ void set_trouts_inconsistent(void);
* 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. */
......
......@@ -24,7 +24,7 @@
*/
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. */
......
......@@ -999,7 +999,11 @@ void dump_irn(ir_node *n);
/** 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 */
......
......@@ -22,18 +22,20 @@
/**
* 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
* 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).
*
* If callee information is valid, we also optimize polymorphic Calls.
*/
void optimize_funccalls(void);
......
......@@ -315,7 +315,7 @@ static compound_graph_path *rec_get_accessed_path(ir_node *ptr, int depth) {
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);
......@@ -466,12 +466,12 @@ static int optimize_load(ir_node *load)
}
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);
*/
path = get_accessed_path(ptr);
if (path) {
ir_node *c;
......@@ -479,13 +479,13 @@ static int optimize_load(ir_node *load)
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));
/*
{
int j;
for (j = 0; j < get_compound_graph_path_length(path); ++j) {
......@@ -496,8 +496,20 @@ static int optimize_load(ir_node *load)
}
printf("\n");
}
} else
*/
} 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");
*/
}
}
/* we changed the irg, but try further */
......
......@@ -142,7 +142,7 @@ static void simple_dump_graph(dumper_t *dmp, graph_entry_t *entry)
}
else {
if (entry->ent)
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);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment