changed functiontype in irgwalk to not include the pointer *.
This can be removed if crecoder includes a type analysis so that
it can find out whether a typedef is a pointer.
[r509]
+ * 29.10.2002 Goetz
+ Representation of value compounds is not good, especially with
+ calls.
+
+ * 29.10.2002 Goetz
+ We can not represent bitfield members of structs in C.
+ A struct can have fields with n bits, n e.g. set to 3...
+
+ * 29.10.2002 Goetz
+ If parameter variables are dereferenced they must be represented
+ by an entity in the stack frame type. We need a mechanism to
+ find out which fields were parameters so that the parameter
+ passing space on the frame can be used for the parameters.
+
+ 19.11.2001 Goetz
SymConst mit ident taugt nicht: Wenn man z.B. die Prozedur kennt
sollte man die entitaet der Prozedur angeben koennen. Ermoeglicht
pmap_insert(ldname_map, (void *) get_entity_ld_ident(ent), ent);
}
}
- all_irg_walk((irg_walk_func) sel_methods_walker, NULL, ldname_map);
+ all_irg_walk((irg_walk_func *) sel_methods_walker, NULL, ldname_map);
pmap_destroy(ldname_map);
}
if (get_entity_visibility(ent) != local) {
eset_insert(set, ent);
}
- irg_walk_graph(irg, NULL, (irg_walk_func) free_ana_walker, set);
+ irg_walk_graph(irg, NULL, (irg_walk_func *) free_ana_walker, set);
}
/* Hauptprogramm ist auch frei, auch wenn es nicht "external
* visible" ist. */
pmap_insert(ldname_map, (void *) get_entity_ld_ident(ent), ent);
}
}
- all_irg_walk((irg_walk_func) sel_methods_walker, NULL, ldname_map);
+ all_irg_walk((irg_walk_func *) sel_methods_walker, NULL, ldname_map);
pmap_destroy(ldname_map);
#endif
}
/* $Id$ */
-#include "common.h"
+#include "firm_common.h"
#include "irloop.h"
#ifndef _IRLOOP_T_H_
return NULL;
}
-void irg_out_walk_2(ir_node *node, void (pre)(ir_node*, void*),
- void (post)(ir_node*, void*), void *env) {
+void irg_out_walk_2(ir_node *node, irg_walk_func *pre,
+ irg_walk_func *post, void *env) {
int i;
ir_node *succ;
# include "irgraph.h"
# include "irnode.h"
-
/**********************************************************************/
/** Accessing the out datastructures. **/
/** These routines only work properly if the ir_graph is in state **/
/* Access predecessor n. */
INLINE ir_node *get_Block_cfg_out (ir_node *node, int pos);
+#ifndef _IRG_WALK_FUNC_TYPEDEF_
+#define _IRG_WALK_FUNC_TYPEDEF_
+typedef void (irg_walk_func)(ir_node *, void *);
+#endif
/* Walks over the graph starting at node. Walks also if graph is in state
"outs_inconsistent". Assumes current_ir_graph is set properly. */
void irg_out_walk(ir_node *node,
- void (pre)(ir_node*, void*), void (post)(ir_node*, void*),
+ irg_walk_func *pre, irg_walk_func *post,
void *env);
/* Walks only over Block nodes in the graph. Has it's own visited
flag, so that it can be interleaved with the other walker.
node must be either op_Block or mode_X. */
void irg_out_block_walk(ir_node *node,
- void (pre)(ir_node*, void*), void (post)(ir_node*, void*),
+ irg_walk_func *pre, irg_walk_func *post,
void *env);
/**********************************************************************/
typedef struct ir_node ir_node;
#endif
+/* to resolve recursion between entity.h and type.h */
#ifndef _ENTITY_TYPEDEF_
#define _ENTITY_TYPEDEF_
-/* to resolve recursion between entity.h and type.h */
typedef struct entity entity;
#endif
* No result.
***
*/
-void dbg_init( void (merge_pair)(ir_node *nw, ir_node *old, dbg_action info),
- void (merge_sets)(ir_node **new_nodes, int n_new_nodes,
- ir_node **old_nodes, int n_old_nodes,
- dbg_action info)
- );
+
+
+typedef void (merge_pair_func)(ir_node *, ir_node *, dbg_action);
+typedef void (merge_sets_func)(ir_node **, int, ir_node **, int, dbg_action);
+
+void dbg_init(merge_pair_func *mpf, merge_sets_func *msf);
#endif /* _DBGINFO_H_ */
# include <stdio.h>
# include <assert.h>
-# include "common.h"
+# include "firm_common.h"
/****h* libfirm/ident
*
link(start, get_irg_frame(irg));
link(start, get_irg_globals(irg));
/* walk */
- irg_walk_graph(irg, clear_link, (irg_walk_func) collect_phicallproj_walker, &end);
+ irg_walk_graph(irg, clear_link, (irg_walk_func *) collect_phicallproj_walker, &end);
}
}
ir_graph * irg = get_entity_irg(marked[i]);
ir_node * node = get_irg_end(irg);
/* collect calls */
- irg_walk_graph(irg, clear_link, (irg_walk_func) collect_call, node);
+ irg_walk_graph(irg, clear_link, (irg_walk_func *) collect_call, node);
/* iterate calls */
for (node = get_irn_link(node); node; node = get_irn_link(node)) {
int i;
# include "irnode_t.h"
# include "irmode_t.h"
# include "ircons.h"
-# include "common_t.h"
+# include "firm_common_t.h"
# include "irvrfy.h"
# include "irop.h"
# include "iropt_t.h"
ir_node *
new_rd_Call (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *store,
- ir_node *callee, int arity, ir_node **in, type *type)
+ ir_node *callee, int arity, ir_node **in, type *tp)
{
ir_node **r_in;
ir_node *res;
res = new_ir_node (db, irg, block, op_Call, mode_T, r_arity, r_in);
- assert(is_method_type(type));
- set_Call_type(res, type);
+ assert(is_method_type(tp));
+ set_Call_type(res, tp);
res->attr.call.callee_arr = NULL;
res = optimize (res);
irn_vrfy (res);
}
INLINE ir_node *new_r_Call (ir_graph *irg, ir_node *block, ir_node *store,
ir_node *callee, int arity, ir_node **in,
- type *type) {
- return new_rd_Call(NULL, irg, block, store, callee, arity, in, type);
+ type *tp) {
+ return new_rd_Call(NULL, irg, block, store, callee, arity, in, tp);
}
INLINE ir_node *new_r_Add (ir_graph *irg, ir_node *block,
ir_node *op1, ir_node *op2, ir_mode *mode) {
ir_node *
new_d_Call (dbg_info* db, ir_node *store, ir_node *callee, int arity, ir_node **in,
- type *type)
+ type *tp)
{
ir_node *res;
res = new_rd_Call (db, current_ir_graph, current_ir_graph->current_block,
- store, callee, arity, in, type);
+ store, callee, arity, in, tp);
#if PRECISE_EXC_CONTEXT
if ((current_ir_graph->phase_state == phase_building) &&
(get_irn_op(res) == op_Call)) /* Could be optimized away. */
ir_node *new_Cond (ir_node *c) {
return new_d_Cond(NULL, c);
}
-ir_node *new_Return (ir_node *store, int arity, ir_node **in) {
+ir_node *new_Return (ir_node *store, int arity, ir_node *in[]) {
return new_d_Return(NULL, store, arity, in);
}
ir_node *new_Raise (ir_node *store, ir_node *obj) {
return (new_d_InstOf (NULL, store, objptr, ent));
}
ir_node *new_Call (ir_node *store, ir_node *callee, int arity, ir_node **in,
- type *type) {
- return new_d_Call(NULL, store, callee, arity, in, type);
+ type *tp) {
+ return new_d_Call(NULL, store, callee, arity, in, tp);
}
ir_node *new_Add (ir_node *op1, ir_node *op2, ir_mode *mode) {
return new_d_Add(NULL, op1, op2, mode);
* attr.con A tarval* pointer to the proper entry in the constant
* table.
*
- * ir_node *new_SymConst (type *type, symconst_kind kind)
+ * ir_node *new_SymConst (type *tp, symconst_kind kind)
* ------------------------------------------------------------
*
* There are three kinds of symbolic constants:
# ifndef _IRCONS_H_
# define _IRCONS_H_
-# include "common.h"
+# include "firm_common.h"
# include "irgraph.h"
# include "irnode.h"
# include "irmode.h"
entity *ent);
ir_node *new_rd_Call (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store,
ir_node *callee, int arity, ir_node **in,
- type *type);
+ type *tp);
ir_node *new_rd_Add (dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *op1, ir_node *op2, ir_mode *mode);
ir_node *new_rd_Sub (dbg_info *db, ir_graph *irg, ir_node *block,
entity *ent);
ir_node *new_r_Call (ir_graph *irg, ir_node *block, ir_node *store,
ir_node *callee, int arity, ir_node **in,
- type *type);
+ type *tp);
ir_node *new_r_Add (ir_graph *irg, ir_node *block,
ir_node *op1, ir_node *op2, ir_mode *mode);
ir_node *new_r_Sub (ir_graph *irg, ir_node *block,
ir_node *new_d_Sel (dbg_info* db, ir_node *store, ir_node *objptr, int arity, ir_node **in,
entity *ent);
ir_node *new_d_Call (dbg_info* db, ir_node *store, ir_node *callee, int arity, ir_node **in,
- type *type);
+ type *tp);
ir_node *new_d_Add (dbg_info* db, ir_node *op1, ir_node *op2, ir_mode *mode);
ir_node *new_d_Sub (dbg_info* db, ir_node *op1, ir_node *op2, ir_mode *mode);
ir_node *new_d_Minus (dbg_info* db, ir_node *op, ir_mode *mode);
entity *ent);
ir_node *new_InstOf (ir_node *store, ir_node *objptr, type *ent);
ir_node *new_Call (ir_node *store, ir_node *callee, int arity, ir_node **in,
- type *type);
+ type *tp);
ir_node *new_CallBegin(ir_node *callee);
ir_node *new_Add (ir_node *op1, ir_node *op2, ir_mode *mode);
ir_node *new_Sub (ir_node *op1, ir_node *op2, ir_mode *mode);
# include "typewalk.h"
# include "irouts.h"
# include "irdom.h"
-# include "common_t.h"
+# include "firm_common_t.h"
# include "irloop.h"
# include "exc.h"
vcg_open(irg, "");
- irg_walk_graph(irg, clear_link, (irg_walk_func) collect_blocks_floats_cg, map);
+ irg_walk_graph(irg, clear_link, (irg_walk_func *) collect_blocks_floats_cg, map);
for (entry = pmap_first(map); entry; entry = pmap_next(map))
pmap_insert(map2, entry->key, entry->value);
for (entry = pmap_first(map); entry; entry = pmap_next(map)) {
pmap_entry * entry;
vcg_open(irg, "");
- irg_walk_graph(irg, clear_link, (irg_walk_func) collect_blocks_floats_cg, map);
+ irg_walk_graph(irg, clear_link, (irg_walk_func *) collect_blocks_floats_cg, map);
for (entry = pmap_first(map); entry; entry = pmap_next(map))
pmap_insert(map2, entry->key, entry->value);
for (entry = pmap_first(map); entry; entry = pmap_next(map)) {
* turn_of_edge_labels
***
*/
-void dump_all_ir_graphs (void dump_graph(ir_graph*));
+typedef void (dump_graph_func)(ir_graph *);
+void dump_all_ir_graphs (dump_graph_func *dump_graph);
/****m* irdump/turn_off_edge_labels
*
#endif
#include "irflag.h"
-#include "common.h"
+#include "firm_common.h"
/* 0 - don't do this optimization
/* @@@ oblivious, no more supported. */
ir_node *get_irg_cstore (ir_graph *irg);
void set_irg_cstore (ir_graph *irg, ir_node *node);
+/* end oblivious */
ir_node *get_irg_frame (ir_graph *irg);
void set_irg_frame (ir_graph *irg, ir_node *node);
phase_high,
phase_low
} irg_phase_state;
+
irg_phase_state get_irg_phase_state (ir_graph *irg);
void set_irg_phase_low(ir_graph *irg);
/* state: loopinfo_state
Loop information describes the loops within the control and
data flow of the procedure.
-typedef enum {
+tpedef enum { @@@ make unrecognizable for jni script!!!
no_loopinfo,
loopinfo_consistent,
loopinfo_inconsistent
} irg_loopinfo_state;
irg_loopinfo_state get_irg_loopinfo_state(ir_graph *irg);
void set_irg_loopinfo_inconsistent(ir_graph *irg);
-*/
+
/* A void * field to link arbritary information to the node. */
void set_irg_link (ir_graph *irg, void *thing);
# include "obst.h"
# include "pset.h"
# include "irgraph.h"
-# include "common_t.h"
+# include "firm_common_t.h"
#define FRAME_TP_SUFFIX "frame_tp"
/* walk over an interprocedural graph (callgraph). Visits only graphs in irg_set. */
static void irg_walk_cg(ir_node * node, int visited, eset * irg_set,
- irg_walk_func pre, irg_walk_func post, void * env) {
+ irg_walk_func *pre, irg_walk_func *post, void * env) {
int i;
ir_graph * rem = current_ir_graph;
ir_node * pred;
ir_graph * irg = ent ? get_entity_irg(ent) : NULL;
if (irg && !eset_contains(irg_set, irg)) {
eset_insert(irg_set, irg);
- irg_walk_graph(irg, (irg_walk_func) collect_irgs, NULL, irg_set);
+ irg_walk_graph(irg, (irg_walk_func *) collect_irgs, NULL, irg_set);
}
}
}
}
-void irg_walk_2(ir_node *node, irg_walk_func pre, irg_walk_func post, void * env)
+void irg_walk_2(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void * env)
{
int i;
assert(node);
}
-void irg_walk(ir_node *node, irg_walk_func pre, irg_walk_func post, void *env)
+void irg_walk(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void *env)
{
assert(node);
if (interprocedural_view) {
ir_graph * irg;
interprocedural_view = false;
eset_insert(irg_set, current_ir_graph);
- irg_walk(node, (irg_walk_func) collect_irgs, NULL, irg_set);
+ irg_walk(node, (irg_walk_func *) collect_irgs, NULL, irg_set);
interprocedural_view = true;
visited = get_max_irg_visited() + 1;
irg_walk_cg(node, visited, irg_set, pre, post, env);
}
-void irg_walk_graph(ir_graph *irg, irg_walk_func pre, irg_walk_func post, void *env) {
+void irg_walk_graph(ir_graph *irg, irg_walk_func *pre, irg_walk_func *post, void *env) {
ir_graph * rem = current_ir_graph;
current_ir_graph = irg;
irg_walk(get_irg_end(irg), pre, post, env);
/* Executes irg_walk(end, pre, post, env) for all irgraphs in irprog.
Sets current_ir_graph properly for each walk. Conserves current
current_ir_graph. */
-void all_irg_walk(irg_walk_func pre, irg_walk_func post, void *env) {
+void all_irg_walk(irg_walk_func *pre, irg_walk_func *post, void *env) {
int i;
ir_graph *irg, *rem;
return old_current;
}
-void cg_walk_2(ir_node *node, irg_walk_func pre, irg_walk_func post, void * env)
+void cg_walk_2(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void * env)
{
int i;
ir_graph *rem = NULL;
/* Walks all irgs in interprocedural view. Visits each node only once. */
-void cg_walk(irg_walk_func pre, irg_walk_func post, void *env) {
+void cg_walk(irg_walk_func *pre, irg_walk_func *post, void *env) {
int i;
ir_graph *rem = current_ir_graph;
int rem_view = interprocedural_view;
return skip_Proj(n);
}
-void irg_block_walk_2(ir_node *node, irg_walk_func pre, irg_walk_func post, void *env)
+void irg_block_walk_2(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void *env)
{
int i;
assert(get_irn_opcode(node) == iro_Block);
/* walks only over Block nodes in the graph. Has it's own visited
flag, so that it can be interleaved with the other walker. */
-void irg_block_walk(ir_node *node, irg_walk_func pre, irg_walk_func post, void *env)
+void irg_block_walk(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void *env)
{
ir_node *block, *pred;
int i;
}
-void irg_block_walk_graph(ir_graph *irg, irg_walk_func pre,
- irg_walk_func post, void *env) {
+void irg_block_walk_graph(ir_graph *irg, irg_walk_func *pre,
+ irg_walk_func *post, void *env) {
ir_graph * rem = current_ir_graph;
current_ir_graph = irg;
irg_block_walk(get_irg_end(irg), pre, post, env);
}
/* Walks over all code in const_code_irg. */
-void walk_const_code(irg_walk_func pre, irg_walk_func post, void *env) {
+void walk_const_code(irg_walk_func *pre, irg_walk_func *post, void *env) {
int i, j;
walk_env my_env;
# include "irnode.h"
/* type of callback function for ir_graph walk */
-typedef void (* irg_walk_func)(ir_node *, void *);
+#ifndef _IRG_WALK_FUNC_TYPEDEF_
+#define _IRG_WALK_FUNC_TYPEDEF_
+typedef void (irg_walk_func)(ir_node *, void *);
+#endif
/* Walks over the ir graph, starting at the node given as first argument.
Executes pre before visiting the predecessor of a node, post after.
flag. It marks the node as visited before executing pre.
The void* env can be used to pass status information between the
pre and post functions. */
-void irg_walk(ir_node *node, irg_walk_func pre, irg_walk_func post, void *env);
+void irg_walk(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void *env);
/* Like "irg_walk", but walks over all reachable nodes in the ir
* graph, starting at the end operation. During the walk current_ir_graph
* is set to irg. */
-void irg_walk_graph(ir_graph *irg, irg_walk_func pre, irg_walk_func post, void *env);
+void irg_walk_graph(ir_graph *irg, irg_walk_func *pre, irg_walk_func *post, void *env);
/* Executes irg_walk(end, pre, post, env) for all irgraphs in irprog.
Sets current_ir_graph properly for each walk. Conserves current
current_ir_graph. In interprocedural view nodes can be visited several
times. */
-void all_irg_walk(irg_walk_func pre, irg_walk_func post, void *env);
+void all_irg_walk(irg_walk_func *pre, irg_walk_func *post, void *env);
/* Walks all irgs in interprocedural view. Visits each node only once.
Sets current_ir_graph properly. */
-void cg_walk(irg_walk_func pre, irg_walk_func post, void *env);
+void cg_walk(irg_walk_func *pre, irg_walk_func *post, void *env);
/* Walks only over Block nodes in the graph. Has it's own visited
flag, so that it can be interleaved with the other walker.
If a none block is passed, starts at the block this node belongs to.
If end is passed also visites kept alive blocks. */
-void irg_block_walk(ir_node *node, irg_walk_func pre, irg_walk_func post, void *env);
+void irg_block_walk(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void *env);
/* Like "irg_block_walk", but walks over all reachable blocks in the
* ir graph, starting at the end block. */
-void irg_block_walk_graph(ir_graph *irg, irg_walk_func pre, irg_walk_func post, void *env);
+void irg_block_walk_graph(ir_graph *irg, irg_walk_func *pre, irg_walk_func *post, void *env);
/* Walks over all code in const_code_irg.
Uses visited flag in const_code_irg. */
-void walk_const_code(irg_walk_func pre, irg_walk_func post, void *env);
+void walk_const_code(irg_walk_func *pre, irg_walk_func *post, void *env);
# endif /* _IRGWALK_H_ */
ir_mode *mode_R;
ir_mode *mode_Z;
-INLINE ir_mode *get_mode_T() { return mode_T; }
-INLINE ir_mode *get_mode_f() { return mode_f; }
-INLINE ir_mode *get_mode_d() { return mode_d; }
-INLINE ir_mode *get_mode_c() { return mode_c; }
-INLINE ir_mode *get_mode_C() { return mode_C; }
-INLINE ir_mode *get_mode_h() { return mode_h; }
-INLINE ir_mode *get_mode_H() { return mode_H; }
-INLINE ir_mode *get_mode_i() { return mode_i; }
-INLINE ir_mode *get_mode_I() { return mode_I; }
-INLINE ir_mode *get_mode_l() { return mode_l; }
-INLINE ir_mode *get_mode_L() { return mode_L; }
-INLINE ir_mode *get_mode_B() { return mode_B; }
-INLINE ir_mode *get_mode_p() { return mode_b; }
-INLINE ir_mode *get_mode_b() { return mode_p; }
-INLINE ir_mode *get_mode_s() { return mode_s; }
-INLINE ir_mode *get_mode_S() { return mode_S; }
-INLINE ir_mode *get_mode_X() { return mode_X; }
-INLINE ir_mode *get_mode_M() { return mode_M; }
-INLINE ir_mode *get_mode_R() { return mode_R; }
-INLINE ir_mode *get_mode_Z() { return mode_Z; }
+INLINE ir_mode *get_modeT() { return mode_T; }
+INLINE ir_mode *get_modef() { return mode_f; }
+INLINE ir_mode *get_moded() { return mode_d; }
+INLINE ir_mode *get_modec() { return mode_c; }
+INLINE ir_mode *get_modeC() { return mode_C; }
+INLINE ir_mode *get_modeh() { return mode_h; }
+INLINE ir_mode *get_modeH() { return mode_H; }
+INLINE ir_mode *get_modei() { return mode_i; }
+INLINE ir_mode *get_modeI() { return mode_I; }
+INLINE ir_mode *get_model() { return mode_l; }
+INLINE ir_mode *get_modeL() { return mode_L; }
+INLINE ir_mode *get_modeB() { return mode_B; }
+INLINE ir_mode *get_modep() { return mode_b; }
+INLINE ir_mode *get_modeb() { return mode_p; }
+INLINE ir_mode *get_modes() { return mode_s; }
+INLINE ir_mode *get_modeS() { return mode_S; }
+INLINE ir_mode *get_modeX() { return mode_X; }
+INLINE ir_mode *get_modeM() { return mode_M; }
+INLINE ir_mode *get_modeR() { return mode_R; }
+INLINE ir_mode *get_modeZ() { return mode_Z; }
void
init_mode (void)
extern ir_mode *mode_Z; /* infinit integers */ /* oblivious */
/* Access routines for JNI Interface */
-ir_mode *get_mode_T();
-ir_mode *get_mode_f();
-ir_mode *get_mode_d();
-ir_mode *get_mode_c();
-ir_mode *get_mode_C();
-ir_mode *get_mode_h();
-ir_mode *get_mode_H();
-ir_mode *get_mode_i();
-ir_mode *get_mode_I();
-ir_mode *get_mode_l();
-ir_mode *get_mode_L();
-ir_mode *get_mode_B();
-ir_mode *get_mode_p();
-ir_mode *get_mode_b();
-ir_mode *get_mode_s();
-ir_mode *get_mode_S();
-ir_mode *get_mode_X();
-ir_mode *get_mode_M();
-ir_mode *get_mode_R();
-ir_mode *get_mode_Z();
+ir_mode *get_modeT();
+ir_mode *get_modef();
+ir_mode *get_moded();
+ir_mode *get_modec();
+ir_mode *get_modeC();
+ir_mode *get_modeh();
+ir_mode *get_modeH();
+ir_mode *get_modei();
+ir_mode *get_modeI();
+ir_mode *get_model();
+ir_mode *get_modeL();
+ir_mode *get_modeB();
+ir_mode *get_modep();
+ir_mode *get_modeb();
+ir_mode *get_modes();
+ir_mode *get_modeS();
+ir_mode *get_modeX();
+ir_mode *get_modeM();
+ir_mode *get_modeR();
+ir_mode *get_modeZ();
/* An enum for this mode */
modecode get_mode_modecode (ir_mode *mode);
}
INLINE void
-set_SymConst_type (ir_node *node, type *type) {
+set_SymConst_type (ir_node *node, type *tp) {
assert ( (node->op == op_SymConst)
&& ( get_SymConst_kind(node) == type_tag
|| get_SymConst_kind(node) == size));
- node->attr.i.tori.typ = type;
+ node->attr.i.tori.typ = tp;
}
INLINE ident *
}
INLINE void
-set_Call_type (ir_node *node, type *type) {
+set_Call_type (ir_node *node, type *tp) {
assert (node->op == op_Call);
- assert (is_method_type(type));
- node->attr.call.cld_tp = type;
+ assert (is_method_type(tp));
+ node->attr.call.cld_tp = tp;
}
int get_Call_n_callees(ir_node * node) {
}
INLINE void
-set_Alloc_type (ir_node *node, type *type) {
+set_Alloc_type (ir_node *node, type *tp) {
assert (node->op == op_Alloc);
- node->attr.a.type = type;
+ node->attr.a.type = tp;
}
INLINE where_alloc
}
INLINE void
-set_Free_type (ir_node *node, type *type) {
+set_Free_type (ir_node *node, type *tp) {
assert (node->op == op_Free);
- node->attr.f = type;
+ node->attr.f = tp;
}
INLINE ir_node **
# include "irgraph.h"
# include "entity.h"
-# include "common.h"
+# include "firm_common.h"
# include "irop.h"
# include "irmode.h"
# include "tv.h"
/* frees the memory. */
void remove_Block_cg_cfgpred_arr(ir_node * node);
-/* exc handling @@@ ajacs specific -- not supported */
-void set_Block_exc (ir_node*, exc_t);
-exc_t get_Block_exc (ir_node*);
-
-void set_Node_exc (ir_node*, exc_t);
-exc_t get_Node_exc (ir_node*);
-
-/* handler handling @@@ ajacs specific -- not supported */
-void set_Block_handler (ir_node*, ir_node*);
-ir_node* get_Block_handler (ir_node*);
-
-void set_Node_handler (ir_node*, ir_node*);
-ir_node* get_Node_handler (ir_node*);
-
INLINE int get_End_n_keepalives(ir_node *end);
INLINE ir_node *get_End_keepalive(ir_node *end, int pos);
INLINE void add_End_keepalive (ir_node *end, ir_node *ka);
INLINE void set_SymConst_kind (ir_node *node, symconst_kind num);
/* Only to access SymConst of kind type_tag or size. Else assertion: */
INLINE type *get_SymConst_type (ir_node *node);
-INLINE void set_SymConst_type (ir_node *node, type *type);
+INLINE void set_SymConst_type (ir_node *node, type *tp);
/* Only to access SymConst of kind linkage_ptr_info. Else assertion: */
INLINE ident *get_SymConst_ptrinfo (ir_node *node);
INLINE void set_SymConst_ptrinfo (ir_node *node, ident *ptrinfo);
INLINE void set_Sel_entity (ir_node *node, entity *ent);
/* @@@ ajacs specific node -- not supported */
-type *get_InstOf_ent (ir_node*);
-void set_InstOf_ent (ir_node*, type*);
-ir_node *get_InstOf_obj (ir_node*);
-void set_InstOf_obj (ir_node*, ir_node*);
-ir_node *get_InstOf_store (ir_node*);
-void set_InstOf_store (ir_node*, ir_node*);
+type *get_InstOf_ent (ir_node *node);
+void set_InstOf_ent (ir_node *node, type *ent);
+ir_node *get_InstOf_obj (ir_node *node);
+void set_InstOf_obj (ir_node *node, ir_node *obj);
+ir_node *get_InstOf_store (ir_node *node);
+void set_InstOf_store (ir_node *node, ir_node *obj);
INLINE ir_node *get_Call_mem (ir_node *node);
INLINE void set_Call_mem (ir_node *node, ir_node *mem);
INLINE ir_node *get_Call_param (ir_node *node, int pos);
INLINE void set_Call_param (ir_node *node, int pos, ir_node *param);
INLINE type *get_Call_type (ir_node *node);
-INLINE void set_Call_type (ir_node *node, type *type);
+INLINE void set_Call_type (ir_node *node, type *tp);
INLINE int get_Call_arity (ir_node *node);
/* Set, get and remove the callee-analysis. */
Ug, /* unordered or greater */
Uge, /* unordered, greater or equal */
Ne, /* unordered, less or greater = not equal */
- True, /* true */
- not_mask = Leg /* bits to flip to negate comparison */
+ True /* true */
+ /* not_mask = Leg /* bits to flip to negate comparison * @@ hack for jni interface */
} pnc_number;
+#define not_mask Leg
INLINE char *get_pnc_string(int pnc);
INLINE int get_negated_pnc(int pnc);
INLINE ir_node *get_Cmp_left (ir_node *node);
INLINE ir_node *get_Alloc_size (ir_node *node);
INLINE void set_Alloc_size (ir_node *node, ir_node *size);
INLINE type *get_Alloc_type (ir_node *node);
-INLINE void set_Alloc_type (ir_node *node, type *type);
+INLINE void set_Alloc_type (ir_node *node, type *tp);
typedef enum {
stack_alloc, /* Alloc allocates the object on the stack. */
heap_alloc /* Alloc allocates the object on the heap. */
INLINE ir_node *get_Free_size (ir_node *node);
INLINE void set_Free_size (ir_node *node, ir_node *size);
INLINE type *get_Free_type (ir_node *node);
-INLINE void set_Free_type (ir_node *node, type *type);
+INLINE void set_Free_type (ir_node *node, type *tp);
INLINE ir_node **get_Sync_preds_arr (ir_node *node);
INLINE int get_Sync_n_preds (ir_node *node);
#include "ident.h"
#define DDMSG printf("%s(l.%i)\n", __FUNCTION__, __LINE__)
-#define DDMSG1(X) printf("%s(l.%i) %s\n", __FUNCTION__, __LINE__, \
- id_to_str(get_irn_opident(X)))
-#define DDMSG2(X) printf("%s(l.%i) %s%s: %ld\n", __FUNCTION__, __LINE__, \
- id_to_str(get_irn_opident(X)), id_to_str(get_irn_modeident(X)), \
- get_irn_node_nr(X))
-#define DDMSG3(X) printf("%s(l.%i) %s: %p\n", __FUNCTION__, __LINE__, \
- print_firm_kind(X), (X))
-#define DDMSG4(X) xprintf("%s(l.%i) %I %I: %p\n", __FUNCTION__, __LINE__, \
- get_type_tpop_nameid(X), get_type_ident(X), (X))
-#define DDMSG5(X) printf("%s%s: %ld", \
- id_to_str(get_irn_opident(X)), id_to_str(get_irn_modeident(X)), \
- get_irn_node_nr(X))
-
-
-#define DDMN(X) xprintf("%s(l.%i) %I%I: %ld (%p)\n", __FUNCTION__, __LINE__, \
- get_irn_opident(X), get_irn_modeident(X), get_irn_node_nr(X), (X))
-#define DDMNB(X) xprintf("%I%I: %ld (in block %ld)\n", \
- get_irn_opident(X), get_irn_modeident(X), get_irn_node_nr(X), \
- get_irn_node_nr(get_nodes_Block(X)))
-#define DDMT(X) xprintf("%s(l.%i) %I %I: %p\n", __FUNCTION__, __LINE__, \
- get_type_tpop_nameid(X), get_type_ident(X), (X))
-#define DDME(X) xprintf("%s(l.%i) %I: %p\n", __FUNCTION__, __LINE__, \
- get_entity_ident(X), (X))
+#define DDMSG1(X) printf("%s(l.%i) %s\n", __FUNCTION__, __LINE__, id_to_str(get_irn_opident(X)))
+#define DDMSG2(X) printf("%s(l.%i) %s%s: %ld\n", __FUNCTION__, __LINE__, id_to_str(get_irn_opident(X)), id_to_str(get_irn_modeident(X)), get_irn_node_nr(X))
+#define DDMSG3(X) printf("%s(l.%i) %s: %p\n", __FUNCTION__, __LINE__, print_firm_kind(X), (X))
+#define DDMSG4(X) xprintf("%s(l.%i) %I %I: %p\n", __FUNCTION__, __LINE__, get_type_tpop_nameid(X), get_type_ident(X), (X))
+#define DDMSG5(X) printf("%s%s: %ld", id_to_str(get_irn_opident(X)), id_to_str(get_irn_modeident(X)), get_irn_node_nr(X))
+
+
+#define DDMN(X) xprintf("%s(l.%i) %I%I: %ld (%p)\n", __FUNCTION__, __LINE__, get_irn_opident(X), get_irn_modeident(X), get_irn_node_nr(X), (X))
+#define DDMNB(X) xprintf("%I%I: %ld (in block %ld)\n", get_irn_opident(X), get_irn_modeident(X), get_irn_node_nr(X), get_irn_node_nr(get_nodes_Block(X)))
+#define DDMT(X) xprintf("%s(l.%i) %I %I: %p\n", __FUNCTION__, __LINE__, get_type_tpop_nameid(X), get_type_ident(X), (X))
+#define DDME(X) xprintf("%s(l.%i) %I: %p\n", __FUNCTION__, __LINE__, get_entity_ident(X), (X))
# endif /* _IRNODE_H_ */
# include "irnode.h"
# include "xprintf.h"
# include "irop_t.h"
-# include "common_t.h"
+# include "firm_common_t.h"
# include "irdom_t.h" /* For size of struct dom_info. */
# include "dbginfo.h"
# define _IRPROG_T_H_
#include "irprog.h"
-#include "common_t.h"
+#include "firm_common_t.h"
struct ir_prog {
firm_kind kind;
/* Copyright (c) 2002 by Universität Karlsruhe (TH). All Rights Reserved */
/*
-** Time-stamp: <Friday, 05.07.2002, 11:09:07 goetz@i44pc2.info.uni-karlsruhe.de>
+** Time-stamp: <Monday, 04.11.2002, 17:28:27 goetz@i44pc2.info.uni-karlsruhe.de>
*/
/***
if (exc_invalid == get_Block_exc (block))
{
- for (i = 0; (i < n) && is_entry; i ++)
+ for (i = 0; (i < n) && (is_entry == true); i ++)
if (is_exc_jmp (get_irn_n (block, i)))
continue;
else
bool no_handler = true;
- for (i = 0; (i < n) && no_handler; i ++)
+ for (i = 0; (i < n) && (no_handler == true); i ++)
{
succ = get_irn_out (block, i);
return (exc_region == get_Block_exc (block));
- return (TRUE);
+ return (true);
}
/*
int n_blocks = env->dt->n_blocks;
int i = 0;
- for (i = 0; (i < n_blocks) && no_handler; i ++)
+ for (i = 0; (i < n_blocks) && (no_handler == true); i ++)
if (0 != (env->dt->masks [i] & block_mask)) /* if dominator */
if (is_handler_entry (graph, env->dt->blocks [i])) /* is handler entry */
no_handler = false;
/* Copyright (c) 2002 by Universität Karlsruhe (TH). All Rights Reserved */
/*
-** Time-stamp: <Friday, 26.07.2002 15:43:30h liekweg@i44pc11.info.uni-karlsruhe.de>
+** Time-stamp: <Monday, 04.11.2002, 17:32:28 goetz@i44pc2.info.uni-karlsruhe.de>
*/
/***
# include "irop.h"
# include "irouts.h"
-# include <bool.h>
+#include "bool.h"
typedef enum {
exc_invalid = 0, /* not yet computed */
bool is_handler_block (ir_graph*, ir_node*);
bool is_cont_entry (ir_graph*, ir_node*);
+void set_Block_exc (ir_node*, exc_t);
+exc_t get_Block_exc (ir_node*);
+
+void set_Node_exc (ir_node*, exc_t);
+exc_t get_Node_exc (ir_node*);
+
+/* handler handling @@@ ajacs specific -- not supported */
+void set_Block_handler (ir_node*, ir_node*);
+ir_node* get_Block_handler (ir_node*);
+
+void set_Node_handler (ir_node*, ir_node*);
+ir_node* get_Node_handler (ir_node*);
# endif /* def _EXC_H_ */
/* Copyright (c) 2002 by Universität Karlsruhe (TH). All Rights Reserved */
/*
-** Time-stamp: <Friday, 05.07.2002, 11:06:38 goetz@i44pc2.info.uni-karlsruhe.de>
+** Time-stamp: <Thursday, 31.10.2002, 16:03:00 goetz@i44pc2.info.uni-karlsruhe.de>
*/
/***
if (new_mask != old_mask)
{
- w->changed = TRUE;
+ w->changed = true;
_set_mask (dt, block_index, new_mask);
# ifdef VERBOSE_libfirm
w->dt = dt;
w->start_block = start_block;
- w->changed = TRUE; /* at least one walk */
+ w->changed = true; /* at least one walk */
/* do the walk: */
{
while (w->changed)
{
- w->changed = FALSE;
+ w->changed = false;
irg_block_walk (end_block, update_dominators, update_dominators, (void*) w);
walks ++;
}
}
-unsigned long get_entity_visited(entity *entity) {
- assert (entity);
- return entity->visit;
+unsigned long get_entity_visited(entity *ent) {
+ assert (ent);
+ return ent->visit;
}
-void set_entity_visited(entity *entity, unsigned long num) {
- assert (entity);
- entity->visit = num;
+void set_entity_visited(entity *ent, unsigned long num) {
+ assert (ent);
+ ent->visit = num;
}
/* Sets visited field in entity to entity_visited. */
-void mark_entity_visited(entity *entity) {
- assert (entity);
- entity->visit = type_visited;
+void mark_entity_visited(entity *ent) {
+ assert (ent);
+ ent->visit = type_visited;
}
/** ENTITY **/
/*******************************************************************/
+/* to resolve recursion between entity.h and irgraph.h */
#ifndef _IR_GRAPH_TYPEDEF_
#define _IR_GRAPH_TYPEDEF_
-/* to resolve recursion between entity.h and irgraph.h */
typedef struct ir_graph ir_graph;
#endif
* SOURCE
*/
+/* to resolve recursion between entity.h and type.h */
#ifndef _ENTITY_TYPEDEF_
#define _ENTITY_TYPEDEF_
-/* to resolve recursion between entity.h and type.h */
typedef struct entity entity;
#endif
bool equal_entity(entity *ent1, entity *ent2);
-unsigned long get_entity_visited(entity *entity);
-void set_entity_visited(entity *entity, unsigned long num);
+unsigned long get_entity_visited(entity *ent);
+void set_entity_visited(entity *ent, unsigned long num);
/* Sets visited field in entity to entity_visited. */
-void mark_entity_visited(entity *entity);
+void mark_entity_visited(entity *ent);
/*****/
# include "entity.h"
-#ifndef _IR_GRAPH_TYPEDEF_
-#define _IR_GRAPH_TYPEDEF_
-/* to resolve recursion between entity.h and irgraph.h */
-typedef struct ir_graph ir_graph;
-#endif
-
struct entity {
firm_kind kind;
ident *name; /* name of this entity */
}
ident *
-mangle_type (type *type)
+mangle_type (type *tp)
{
char *cp;
int len;
ident *res;
- assert (type->kind == k_type);
- /* assert (type->type_op->code == tpo_class); */
+ assert (tp->kind == k_type);
+ /* assert (tp->type_op->code == tpo_class); */
- xoprintf (&mangle_obst, "%I", type->name);
+ xoprintf (&mangle_obst, "%I", tp->name);
len = obstack_object_size (&mangle_obst);
cp = obstack_finish (&mangle_obst);
res = id_from_str (cp, len);
ident *mangle_entity (entity *ent);
/* Sorry, I'm not sure what this does... seems to copy the string. */
-ident *mangle_type (type *type);
+ident *mangle_type (type *tp);
/* mangle underscore: Returns a new ident that represents first_scnd. */
ident *mangle_u (ident *first, ident* scnd);
assert(pos >= 0 && pos < get_method_n_params(method));
return method->attr.ma.param_type[pos] = skip_tid(method->attr.ma.param_type[pos]);
}
-void set_method_param_type(type *method, int pos, type* type) {
+void set_method_param_type(type *method, int pos, type* tp) {
assert(method && (method->type_op == type_method));
assert(pos >= 0 && pos < get_method_n_params(method));
- method->attr.ma.param_type[pos] = type;
+ method->attr.ma.param_type[pos] = tp;
}
int get_method_n_ress (type *method) {
assert(pos >= 0 && pos < get_method_n_ress(method));
return method->attr.ma.res_type[pos] = skip_tid(method->attr.ma.res_type[pos]);
}
-void set_method_res_type(type *method, int pos, type* type) {
+void set_method_res_type(type *method, int pos, type* tp) {
assert(method && (method->type_op == type_method));
assert(pos >= 0 && pos < get_method_n_ress(method));
- method->attr.ma.res_type[pos] = type;
+ method->attr.ma.res_type[pos] = tp;
}
/* typecheck */
assert(pos >= 0 && pos < get_union_n_types(uni));
return uni->attr.ua.unioned_type[pos] = skip_tid(uni->attr.ua.unioned_type[pos]);
}
-void set_union_unioned_type (type *uni, int pos, type *type) {
+void set_union_unioned_type (type *uni, int pos, type *tp) {
assert(uni && (uni->type_op == type_union));
assert(pos >= 0 && pos < get_union_n_types(uni));
- uni->attr.ua.unioned_type[pos] = type;
+ uni->attr.ua.unioned_type[pos] = tp;
}
ident *get_union_delim_nameid (type *uni, int pos) {
assert(uni && (uni->type_op == type_union));
return array->attr.aa.order[dimension];
}
-void set_array_element_type (type *array, type *type) {
+void set_array_element_type (type *array, type *tp) {
assert(array && (array->type_op == type_array));
- assert(!is_method_type(type));
- array->attr.aa.element_type = type;
+ assert(!is_method_type(tp));
+ array->attr.aa.element_type = tp;
}
type *get_array_element_type (type *array) {
assert(array && (array->type_op == type_array));
assert(pointer && (pointer->type_op == type_pointer));
}
/* manipulate fields of type_pointer */
-void set_pointer_points_to_type (type *pointer, type *type) {
+void set_pointer_points_to_type (type *pointer, type *tp) {
assert(pointer && (pointer->type_op == type_pointer));
- pointer->attr.pa.points_to = type;
+ pointer->attr.pa.points_to = tp;
}
type *get_pointer_points_to_type (type *pointer) {
assert(pointer && (pointer->type_op == type_pointer));
# define _TYPE_H_
# include "tpop.h"
-# include "common.h"
+# include "firm_common.h"
# include "ident.h"
# include "irmode.h"
# include "bool.h"
# include "dbginfo.h"
+/* to resolve recursion between entity.h and type.h */
#ifndef _ENTITY_TYPEDEF_
#define _ENTITY_TYPEDEF_
-/* to resolve recursion between entity.h and type.h */
typedef struct entity entity;
#endif
/* Set and get a class' dfn --
@@@ This is an undocumented field, subject to change! */
-void set_class_dfn (type*, int);
-int get_class_dfn (type*);
+void set_class_dfn (type *clss, int dfn);
+int get_class_dfn (type *clss);
/* typecheck */
bool is_class_type(type *clss);
/* manipulate private fields of method. */
int get_method_n_params (type *method);
type *get_method_param_type(type *method, int pos);
-void set_method_param_type(type *method, int pos, type* type);
+void set_method_param_type(type *method, int pos, type* tp);
int get_method_n_ress (type *method);
type *get_method_res_type(type *method, int pos);
-void set_method_res_type(type *method, int pos, type* type);
+void set_method_res_type(type *method, int pos, type* tp);
/* typecheck */
bool is_method_type (type *method);
void set_array_order (type *array, int dimension, int order);
int get_array_order (type *array, int dimension);
-void set_array_element_type (type *array, type *type);
+void set_array_element_type (type *array, type *tp);
type *get_array_element_type (type *array);
void set_array_element_entity (type *array, entity *ent);
type *new_d_type_pointer (ident *name, type *points_to, dbg_info* db);
/* manipulate fields of type_pointer */
-void set_pointer_points_to_type (type *pointer, type *type);
+void set_pointer_points_to_type (type *pointer, type *tp);
type *get_pointer_points_to_type (type *pointer);
/* typecheck */
# include "type_or_entity.h"
+typedef void (type_walk_func)(type_or_ent *, void *);
+
/** Walks over all type information reachable from global roots.
Touches every type and entity in unspecified order. If new
types/entities are created during the traversal these will
be visited, too. **/
-void type_walk(void (pre)(type_or_ent*, void*),
- void (post)(type_or_ent*, void*),
+void type_walk(type_walk_func *pre,
+ type_walk_func *post,
void *env);
/** walks over all type information reachable from irg **/
void type_walk_irg(ir_graph *irg,
- void (pre)(type_or_ent*, void*),
- void (post)(type_or_ent*, void*),
+ type_walk_func *pre,
+ type_walk_func *post,
void *env);
/** Walks over all type information reachable from global roots.
during the traversal these will be visited, too. **/
/** @@@ should be named class-walk **/
/* @@@ will be removed? */
-void type_walk_super2sub(void (pre)(type_or_ent*, void*),
- void (post)(type_or_ent*, void*),
+void type_walk_super2sub(type_walk_func *pre,
+ type_walk_func *post,
void *env);
/** Walks over all type information reachable from global roots.
- second the class itself
If new classes are created during the traversal these
will be visited, too. **/
-void type_walk_super(void (pre)(type_or_ent*, void*),
- void (post)(type_or_ent*, void*),
+void type_walk_super(type_walk_func *pre,
+ type_walk_func *post,
void *env);
/* Same as type_walk_super2sub, but visits only class types.
Does not visit global type, frame types.
*/
/* @@@ ?? something is wrong with this. */
-void class_walk_super2sub(void (pre)(type*, void*),
- void (post)(type*, void*),
+void class_walk_super2sub(type_walk_func *pre,
+ type_walk_func *post,
void *env);
/* Walks over all entities in the type */
+typedef void (entity_walk_func)(entity *, void *);
void walk_types_entities(type *tp,
- void (doit)(entity*, void*),
+ entity_walk_func *doit,
void *env);
#endif /* _TYPEWALK_H_ */
typedef struct tarval tarval;
#endif
-#include "gmp.h"
-#undef __need_size_t /* erroneously defined by 1.3.2's gmp.h */
-
/* how to represent target types on host */
typedef float tarval_f;
typedef double tarval_d;
typedef long tarval_chil;
typedef unsigned long tarval_CHIL;
-typedef MP_INT tarval_Z;
+typedef int tarval_Z; /* Do not use!!! */
typedef struct {
/* if ent then xname is missing or mangled from ent,
else if xname then xname is a linker symbol that is not mangled
tarval_d d; /* double */
tarval_chil chil; /* signed integral */
tarval_CHIL CHIL; /* unsigned integral */
- tarval_Z Z; /* universal int */
+ tarval_Z Z; /* @@@ Do not use!!! universal int */
tarval_p p; /* pointer */
bool b; /* boolean */
tarval_B B; /* universal bits */
ir_mode *mode;
};
+
extern tarval *tarval_bad; tarval *get_tarval_bad();
/* We should have a tarval_undefined */
extern tarval *tarval_b_false; tarval *get_tarval_b_false ();
void tarval_init_1 (void);
void tarval_init_2 (void);
-/* Hash function on tarvals */
-unsigned tarval_hash (tarval *);
-
/* ************************ Constructors for tarvals ************************ */
-tarval *tarval_Z_from_str (const char *, size_t, int base);
-tarval *tarval_B_from_str (const char *, size_t);
-tarval *tarval_f_from_str (const char *, size_t);
-tarval *tarval_d_from_str (const char *, size_t);
-tarval *tarval_s_from_str (const char *, size_t);
-tarval *tarval_S_from_str (const char *, size_t);
-tarval *tarval_int_from_str (const char *, size_t, int base, ir_mode *m);
-tarval *tarval_from_long (ir_mode *, long);
-
-tarval *tarval_p_from_str (const char *);
+/*tarval *tarval_Z_from_str (const char *s, size_t len, int base);*/
+tarval *tarval_f_from_str (const char *s, size_t len);
+tarval *tarval_d_from_str (const char *s, size_t len);
+tarval *tarval_int_from_str (const char *s, size_t len, int base, ir_mode *m);
+tarval *tarval_from_long (ir_mode *m, long val);
+
+tarval *tarval_p_from_str (const char *xname);
/* The tarval represents the address of the entity. As the address must
be constant the entity must have as owner the global type. */
-tarval *tarval_p_from_entity (entity *);
+tarval *tarval_p_from_entity (entity *ent);
-tarval *tarval_convert_to (tarval *, ir_mode *);
+tarval *tarval_convert_to (tarval *src, ir_mode *m);
/* Building an irm_C, irm_s, irm_S or irm_B target value step by step. */
void tarval_start (void);
-void tarval_append (const char *, size_t);
-void tarval_append1 (char);
-tarval *tarval_finish_as (ir_mode *);
+void tarval_append (const char *p, size_t n);
+void tarval_append1 (char ch);
+tarval *tarval_finish_as (ir_mode *m);
tarval *tarval_cancel (void); /* returns tarval_bad */
-\f
/* The flags for projecting a comparison result */
typedef enum {
irpn_False=0, /* 0000 false */
irpn_Ug, /* 1100 unordered or greater */
irpn_Uge, /* 1101 unordered, greater or equal */
irpn_Ne, /* 1110 unordered, less or greater = not equal */
- irpn_True, /* 1111 true */
- irpn_notmask = irpn_Leg
+ irpn_True /* 1111 true */
+ /*irpn_notmask = irpn_Leg @@@ removed for JNI builder */
} ir_pncmp;
+#define irpn_notmask irpn_Leg
/* ******************** Arithmethic operations on tarvals ******************** */
/* Compare a with b and return an ir_pncmp describing the relation
ir_pncmp tarval_comp (tarval *a, tarval *b);
tarval *tarval_neg (tarval *a);
-tarval *tarval_add (tarval *, tarval *);
-tarval *tarval_sub (tarval *, tarval *);
-tarval *tarval_mul (tarval *, tarval *);
-tarval *tarval_quo (tarval *, tarval *);
-tarval *tarval_div (tarval *, tarval *);
-tarval *tarval_mod (tarval *, tarval *);
-tarval *tarval_abs (tarval *);
-tarval *tarval_and (tarval *, tarval *);
-tarval *tarval_or (tarval *, tarval *);
-tarval *tarval_eor (tarval *, tarval *);
-tarval *tarval_shl (tarval *, tarval *);
-tarval *tarval_shr (tarval *, tarval *);
+tarval *tarval_add (tarval *a, tarval *b);
+tarval *tarval_sub (tarval *a, tarval *b);
+tarval *tarval_mul (tarval *a, tarval *b);
+tarval *tarval_quo (tarval *a, tarval *b);
+tarval *tarval_div (tarval *a, tarval *b);
+tarval *tarval_mod (tarval *a, tarval *b);
+tarval *tarval_abs (tarval *a);
+tarval *tarval_and (tarval *a, tarval *b);
+tarval *tarval_or (tarval *a, tarval *b);
+tarval *tarval_eor (tarval *a, tarval *b);
+tarval *tarval_shl (tarval *a, tarval *b);
+tarval *tarval_shr (tarval *a, tarval *b);
/* Identifying some tarvals */
-long tarval_classify (tarval *);
-long tarval_ord (tarval *, int *fail);
-
-/* moved to tv_t.h
- int tarval_print (XP_PAR1, const xprintf_info *, XP_PARN); */
+long tarval_classify (tarval *tv);
+long tarval_ord (tarval *tv, int *fail);
/* return a mode-specific value */
-
tarval_f tv_val_f (tarval *tv);
tarval_d tv_val_d (tarval *tv);
tarval_chil tv_val_chil (tarval *tv);
tarval_CHIL tv_val_CHIL (tarval *tv);
-tarval_Z tv_val_Z (tarval *tv);
-tarval_p tv_val_p (tarval *tv);
+/*tarval_Z tv_val_Z (tarval *tv);*/
+/* @@@ temporarily removed.
+ jni builder can not deal with the return value.
+ All definitions of types are interpreted as pointer values until
+ type analysis exists for crecoder.
+ tarval_p tv_val_p (tarval *tv);
+*/;
bool tv_val_b (tarval *tv);
-tarval_B tv_val_B (tarval *tv);
-tarval_s tv_val_s (tarval *tv);
ir_mode *get_tv_mode (tarval *tv);
/* Returns the entity if the tv is a pointer to an entity, else
# include "tv.h"
# include "misc.h"
+#include "gmp.h"
+#undef __need_size_t /* erroneously defined by 1.3.2's gmp.h */
+
+
+tarval *tarval_S_from_str (const char *s, size_t len);
+tarval *tarval_s_from_str (const char *s, size_t len);
+tarval *tarval_B_from_str (const char *s, size_t len);
+tarval_B tv_val_B (tarval *tv);
+tarval_s tv_val_s (tarval *tv);
+
+
int tarval_print (XP_PAR1, const xprintf_info *, XP_PARN);
+/* Hash function on tarvals */
+unsigned tarval_hash (tarval *);
+
#ifdef NDEBUG
#define TARVAL_VRFY(val) ((void)0)