These are used by the JNI interface.
[r500]
SOURCES = $(INSTALL_HEADERS)
-SOURCES += Makefile.in \
+SOURCES += Makefile.in \
ircons.c irgmod.c irgraph_t.h irnode.c iropt.c irvrfy.c \
irgwalk.c irdump.c irgopt.c irnode_t.h iropt_t.h \
irmode.c irop.c irprog.c irflag.c irgraph.c irmode_t.h \
include $(topdir)/MakeRules
-CPPFLAGS += -I$(top_srcdir)/ir/adt -I$(top_srcdir)/ir/ir -I$(top_srcdir)/ir/common \
- -I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/tr -I$(top_srcdir)/ir/tv \
+CPPFLAGS += -I$(top_srcdir)/ir/adt -I$(top_srcdir)/ir/ir -I$(top_srcdir)/ir/common \
+ -I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/tr -I$(top_srcdir)/ir/tv \
-I$(top_srcdir)/ir/debug -I$(top_srcdir)/ir/ana -I$(top_srcdir)/ir/st
include $(top_srcdir)/MakeTargets
******
*/
-#if 0
-/* The following routines use a global variable that is not external.
- Therefore removed from interface. */
-/* dump a simple node */
-void dump_ir_node (ir_node *node);
-/* dump the edge to the block this node belongs to */
-void dump_ir_block_edge(ir_node *n);
-/* dump edges to our inputs */
-void dump_ir_data_edges(ir_node *n);
-#endif
/* @@@ GL: A hack */
extern char *dump_file_suffix;
combination as control flow operation. */
void inline_method(ir_node *call, ir_graph *called_graph);
-
/* Inlines all small methods at call sites where the called address comes
from a Const node that references the entity representing the called
method.
/********************************************************************/
void optimize_cf(ir_graph *irg);
-
# endif /* _IRGOPT_H_ */
# include "mangle.h"
ir_graph *current_ir_graph;
+INLINE ir_graph *get_current_ir_graph() {
+ return current_ir_graph;
+}
+INLINE void set_current_ir_graph(ir_graph *graph) {
+ current_ir_graph = graph;
+}
+
bool interprocedural_view = false;
+INLINE bool get_interprocedural_view() {
+ return interprocedural_view;
+}
+INLINE void set_interprocedural_view(bool state) {
+ interprocedural_view = state;
+}
#if USE_EXPLICIT_PHI_IN_STACK
/* really defined in ircons.c */
is used by the ir construction interface in ircons and by the
optimizations. */
extern ir_graph *current_ir_graph;
+ir_graph *get_current_ir_graph();
+void set_current_ir_graph(ir_graph *graph);
/* This flag indicate the current view. The behaviour of some methods
* (get_irn_*, set_irn_*) is influenced by this flag. */
extern bool interprocedural_view;
+bool get_interprocedural_view();
+void set_interprocedural_view(bool state);
/* Create a new ir graph to built ir for a procedure.
ent is the entity representing this procedure, i.e., the type of the
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; }
+
void
init_mode (void)
{
extern ir_mode *mode_R; /* block */
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();
+
/* An enum for this mode */
modecode get_mode_modecode (ir_mode *mode);
/* void set_mode_modecode (ir_mode *mode, modecode code); */
shall replace a node. */
/** Fields for optimizations / analysis information **/
struct ir_node **out; /* array of out edges */
- struct dbg_info* dbi; /* A pointer to information for debug support. */
+ struct dbg_info* dbi; /* A pointer to information for debug support. */
/** For debugging **/
#ifdef DEBUG_libfirm
int node_nr; /* a unique node number for each node to make output
# include "irnode_t.h"
# include "misc.h"
-ir_op *op_Block;
-
-ir_op *op_Start;
-ir_op *op_End;
-ir_op *op_Jmp;
-ir_op *op_Cond;
-ir_op *op_Return;
-ir_op *op_Raise;
-
-ir_op *op_Sel;
-ir_op *op_InstOf;
-
-ir_op *op_Const;
-ir_op *op_SymConst;
-
-ir_op *op_Call;
-ir_op *op_Add;
-ir_op *op_Sub;
-ir_op *op_Minus;
-ir_op *op_Mul;
-ir_op *op_Quot;
-ir_op *op_DivMod;
-ir_op *op_Div;
-ir_op *op_Mod;
-ir_op *op_Abs;
-ir_op *op_And;
-ir_op *op_Or;
-ir_op *op_Eor;
-ir_op *op_Not;
-ir_op *op_Cmp;
-ir_op *op_Shl;
-ir_op *op_Shr;
-ir_op *op_Shrs;
-ir_op *op_Rot;
-ir_op *op_Conv;
-
-ir_op *op_Phi;
-
-ir_op *op_Load;
-ir_op *op_Store;
-ir_op *op_Alloc;
-ir_op *op_Free;
-ir_op *op_Sync;
-
-ir_op *op_Tuple;
-ir_op *op_Proj;
-ir_op *op_Id;
-ir_op *op_Bad;
-
-ir_op *op_Unknown;
-ir_op *op_Filter;
-ir_op *op_Break;
-ir_op *op_CallBegin;
-ir_op *op_EndReg;
-ir_op *op_EndExcept;
+ir_op *op_Block; ir_op *get_op_Block () { return op_Block; }
+
+ir_op *op_Start; ir_op *get_op_Start () { return op_Start; }
+ir_op *op_End; ir_op *get_op_End () { return op_End; }
+ir_op *op_Jmp; ir_op *get_op_Jmp () { return op_Jmp; }
+ir_op *op_Cond; ir_op *get_op_Cond () { return op_Cond; }
+ir_op *op_Return; ir_op *get_op_Return () { return op_Return; }
+ir_op *op_Raise; ir_op *get_op_Raise () { return op_Raise; }
+
+ir_op *op_Sel; ir_op *get_op_Sel () { return op_Sel; }
+ir_op *op_InstOf; ir_op *get_op_InstOf () { return op_InstOf; }
+
+ir_op *op_Const; ir_op *get_op_Const () { return op_Const; }
+ir_op *op_SymConst; ir_op *get_op_SymConst () { return op_SymConst; }
+
+ir_op *op_Call; ir_op *get_op_Call () { return op_Call; }
+ir_op *op_Add; ir_op *get_op_Add () { return op_Add; }
+ir_op *op_Sub; ir_op *get_op_Sub () { return op_Sub; }
+ir_op *op_Minus; ir_op *get_op_Minus () { return op_Minus; }
+ir_op *op_Mul; ir_op *get_op_Mul () { return op_Mul; }
+ir_op *op_Quot; ir_op *get_op_Quot () { return op_Quot; }
+ir_op *op_DivMod; ir_op *get_op_DivMod () { return op_DivMod; }
+ir_op *op_Div; ir_op *get_op_Div () { return op_Div; }
+ir_op *op_Mod; ir_op *get_op_Mod () { return op_Mod; }
+ir_op *op_Abs; ir_op *get_op_Abs () { return op_Abs; }
+ir_op *op_And; ir_op *get_op_And () { return op_And; }
+ir_op *op_Or; ir_op *get_op_Or () { return op_Or; }
+ir_op *op_Eor; ir_op *get_op_Eor () { return op_Eor; }
+ir_op *op_Not; ir_op *get_op_Not () { return op_Not; }
+ir_op *op_Cmp; ir_op *get_op_Cmp () { return op_Cmp; }
+ir_op *op_Shl; ir_op *get_op_Shl () { return op_Shl; }
+ir_op *op_Shr; ir_op *get_op_Shr () { return op_Shr; }
+ir_op *op_Shrs; ir_op *get_op_Shrs () { return op_Shrs; }
+ir_op *op_Rot; ir_op *get_op_Rot () { return op_Rot; }
+ir_op *op_Conv; ir_op *get_op_Conv () { return op_Conv; }
+
+ir_op *op_Phi; ir_op *get_op_Phi () { return op_Phi; }
+
+ir_op *op_Load; ir_op *get_op_Load () { return op_Load; }
+ir_op *op_Store; ir_op *get_op_Store () { return op_Store; }
+ir_op *op_Alloc; ir_op *get_op_Alloc () { return op_Alloc; }
+ir_op *op_Free; ir_op *get_op_Free () { return op_Free; }
+ir_op *op_Sync; ir_op *get_op_Sync () { return op_Sync; }
+
+ir_op *op_Tuple; ir_op *get_op_Tuple () { return op_Tuple; }
+ir_op *op_Proj; ir_op *get_op_Proj () { return op_Proj; }
+ir_op *op_Id; ir_op *get_op_Id () { return op_Id; }
+ir_op *op_Bad; ir_op *get_op_Bad () { return op_Bad; }
+
+ir_op *op_Unknown; ir_op *get_op_Unknown () { return op_Unknown; }
+ir_op *op_Filter; ir_op *get_op_Filter () { return op_Filter; }
+ir_op *op_Break; ir_op *get_op_Break () { return op_Break; }
+ir_op *op_CallBegin; ir_op *get_op_CallBegin () { return op_CallBegin; }
+ir_op *op_EndReg; ir_op *get_op_EndReg () { return op_EndReg; }
+ir_op *op_EndExcept; ir_op *get_op_EndExcept () { return op_EndExcept; }
ir_op *
# ifndef _IROP_H_
# define _IROP_H_
-# include <stddef.h>
# include "ident.h"
typedef enum {
typedef struct ir_op ir_op;
-extern ir_op *op_Block;
-
-extern ir_op *op_Start;
-extern ir_op *op_End;
-extern ir_op *op_Jmp;
-extern ir_op *op_Cond;
-extern ir_op *op_Return;
-extern ir_op *op_Raise;
-extern ir_op *op_Sel;
-extern ir_op *op_InstOf;
-
-extern ir_op *op_Const;
-extern ir_op *op_SymConst;
-
-extern ir_op *op_Call;
-extern ir_op *op_Add;
-extern ir_op *op_Sub;
-extern ir_op *op_Minus;
-extern ir_op *op_Mul;
-extern ir_op *op_Quot;
-extern ir_op *op_DivMod;
-extern ir_op *op_Div;
-extern ir_op *op_Mod;
-extern ir_op *op_Abs;
-extern ir_op *op_And;
-extern ir_op *op_Or;
-extern ir_op *op_Eor;
-extern ir_op *op_Not;
-extern ir_op *op_Cmp;
-extern ir_op *op_Shl;
-extern ir_op *op_Shr;
-extern ir_op *op_Shrs;
-extern ir_op *op_Rot;
-extern ir_op *op_Conv;
-
-extern ir_op *op_Phi;
-
-extern ir_op *op_Load;
-extern ir_op *op_Store;
-extern ir_op *op_Alloc;
-extern ir_op *op_Free;
-
-extern ir_op *op_Sync;
-
-extern ir_op *op_Tuple;
-extern ir_op *op_Proj;
-extern ir_op *op_Id;
-extern ir_op *op_Bad;
-
-extern ir_op *op_Unknown;
-extern ir_op *op_Filter;
-extern ir_op *op_Break;
-extern ir_op *op_CallBegin;
-extern ir_op *op_EndReg;
-extern ir_op *op_EndExcept;
+extern ir_op *op_Block; ir_op *get_op_Block ();
+
+extern ir_op *op_Start; ir_op *get_op_Start ();
+extern ir_op *op_End; ir_op *get_op_End ();
+extern ir_op *op_Jmp; ir_op *get_op_Jmp ();
+extern ir_op *op_Cond; ir_op *get_op_Cond ();
+extern ir_op *op_Return; ir_op *get_op_Return ();
+extern ir_op *op_Raise; ir_op *get_op_Raise ();
+extern ir_op *op_Sel; ir_op *get_op_Sel ();
+extern ir_op *op_InstOf; ir_op *get_op_InstOf ();
+
+extern ir_op *op_Const; ir_op *get_op_Const ();
+extern ir_op *op_SymConst; ir_op *get_op_SymConst ();
+
+extern ir_op *op_Call; ir_op *get_op_Call ();
+extern ir_op *op_Add; ir_op *get_op_Add ();
+extern ir_op *op_Sub; ir_op *get_op_Sub ();
+extern ir_op *op_Minus; ir_op *get_op_Minus ();
+extern ir_op *op_Mul; ir_op *get_op_Mul ();
+extern ir_op *op_Quot; ir_op *get_op_Quot ();
+extern ir_op *op_DivMod; ir_op *get_op_DivMod ();
+extern ir_op *op_Div; ir_op *get_op_Div ();
+extern ir_op *op_Mod; ir_op *get_op_Mod ();
+extern ir_op *op_Abs; ir_op *get_op_Abs ();
+extern ir_op *op_And; ir_op *get_op_And ();
+extern ir_op *op_Or; ir_op *get_op_Or ();
+extern ir_op *op_Eor; ir_op *get_op_Eor ();
+extern ir_op *op_Not; ir_op *get_op_Not ();
+extern ir_op *op_Cmp; ir_op *get_op_Cmp ();
+extern ir_op *op_Shl; ir_op *get_op_Shl ();
+extern ir_op *op_Shr; ir_op *get_op_Shr ();
+extern ir_op *op_Shrs; ir_op *get_op_Shrs ();
+extern ir_op *op_Rot; ir_op *get_op_Rot ();
+extern ir_op *op_Conv; ir_op *get_op_Conv ();
+
+extern ir_op *op_Phi; ir_op *get_op_Phi ();
+
+extern ir_op *op_Load; ir_op *get_op_Load ();
+extern ir_op *op_Store; ir_op *get_op_Store ();
+extern ir_op *op_Alloc; ir_op *get_op_Alloc ();
+extern ir_op *op_Free; ir_op *get_op_Free ();
+
+extern ir_op *op_Sync; ir_op *get_op_Sync ();
+
+extern ir_op *op_Tuple; ir_op *get_op_Tuple ();
+extern ir_op *op_Proj; ir_op *get_op_Proj ();
+extern ir_op *op_Id; ir_op *get_op_Id ();
+extern ir_op *op_Bad; ir_op *get_op_Bad ();
+
+extern ir_op *op_Unknown; ir_op *get_op_Unknown ();
+extern ir_op *op_Filter; ir_op *get_op_Filter ();
+extern ir_op *op_Break; ir_op *get_op_Break ();
+extern ir_op *op_CallBegin; ir_op *get_op_CallBegin ();
+extern ir_op *op_EndReg; ir_op *get_op_EndReg ();
+extern ir_op *op_EndExcept; ir_op *get_op_EndExcept ();
/* Returns the ident for the opcode name */
/* A variable from where everything in the ir can be accessed. */
ir_prog *irp;
+ir_prog *get_irp() { return irp; }
/* initializes ir_prog. Calles the constructor for an ir_prog. */
void init_irprog(void) {
/* A variable from where everything in the ir can be accessed. */
extern ir_prog *irp;
+ir_prog *get_irp();
/* initializes ir_prog. Calls the constructor for an ir_prog. */
void init_irprog(void);
# include "tpop_t.h"
# include "type_t.h"
-tp_op *type_class;
-tp_op *type_struct;
-tp_op *type_method;
-tp_op *type_union;
-tp_op *type_array;
-tp_op *type_enumeration;
-tp_op *type_pointer;
-tp_op *type_primitive;
-tp_op *type_id;
+tp_op *type_class; tp_op *get_type_class () { return type_class; }
+tp_op *type_struct; tp_op *get_type_struct () { return type_struct; }
+tp_op *type_method; tp_op *get_type_method () { return type_method; }
+tp_op *type_union; tp_op *get_type_union () { return type_union; }
+tp_op *type_array; tp_op *get_type_array () { return type_array; }
+tp_op *type_enumeration; tp_op *get_type_enumeration() { return type_enumeration; }
+tp_op *type_pointer; tp_op *get_type_pointer () { return type_pointer; }
+tp_op *type_primitive; tp_op *get_type_primitive () { return type_primitive; }
+tp_op *type_id; tp_op *get_type_id () { return type_id; }
tp_op *
new_tpop (tp_opcode code, ident *name, size_t attr_size)
* SOURCE
*/
extern tp_op *type_class;
+tp_op *get_type_class();
/******/
/****d* tpop/type_struct
* SOURCE
*/
extern tp_op *type_struct;
+tp_op *get_type_struct();
/******/
/****d* tpop/type_method
* SOURCE
*/
extern tp_op *type_method;
+tp_op *get_type_method();
/******/
/****d* tpop/type_union
* SOURCE
*/
extern tp_op *type_union;
+tp_op *get_type_union();
/******/
/****d* tpop/type_array
* SOURCE
*/
extern tp_op *type_array;
+tp_op *get_type_array();
/******/
/****d* tpop/type_enumeration
* SOURCE
*/
extern tp_op *type_enumeration;
+tp_op *get_type_enumeration();
/******/
/****d* tpop/type_pointer
* SOURCE
*/
extern tp_op *type_pointer;
+tp_op *get_type_pointer();
/******/
/****d* tpop/type_primitive
* SOURCE
*/
extern tp_op *type_primitive;
+tp_op *get_type_primitive();
/******/
/****d* tpop/type_id
* SOURCE
*/
extern tp_op *type_id;
+tp_op *get_type_id();
/******/
# endif /*_TYPEOP_H_ */
/*******************************************************************/
unsigned long type_visited;
+INLINE void set_master_type_visited(unsigned long val) { type_visited = val; }
+INLINE unsigned long get_master_type_visited() { return type_visited; }
+INLINE void inc_master_type_visited() { type_visited++; }
void free_type(type *tp) {
/* Remove from list of all types */
* SOURCE
*/
extern unsigned long type_visited;
+void set_master_type_visited(unsigned long val);
+unsigned long get_master_type_visited();
+void inc_master_type_visited();
/*****/
/****f* type/is_type
tarval *tarval_d_Inf;
tarval *tarval_p_void;
tarval *tarval_mode_null[irm_max];
+tarval *tarval_mode_min[irm_max];
+tarval *tarval_mode_max[irm_max];
+
+tarval *get_tarval_bad () { return tarval_bad; }
+tarval *get_tarval_b_false () { return tarval_b_false; }
+tarval *get_tarval_b_true () { return tarval_b_true; }
+tarval *get_tarval_d_NaN () { return tarval_d_NaN; }
+tarval *get_tarval_d_Inf () { return tarval_d_Inf; }
+tarval *get_tarval_p_void () { return tarval_p_void; }
+tarval *get_tarval_mode_null(ir_mode *mode)
+ { return tarval_mode_null[get_mode_modecode(mode)]; }
+tarval *get_tarval_mode_min (ir_mode *mode)
+ { return tarval_mode_min[get_mode_modecode(mode)]; }
+tarval *get_tarval_mode_max (ir_mode *mode)
+ { return tarval_mode_max[get_mode_modecode(mode)]; }
# if 0
/* @@@ depends on order of ir_mode */
ir_mode *mode;
};
-extern tarval *tarval_bad;
+extern tarval *tarval_bad; tarval *get_tarval_bad();
/* We should have a tarval_undefined */
-extern tarval *tarval_b_false;
-extern tarval *tarval_b_true;
-extern tarval *tarval_d_NaN;
-extern tarval *tarval_d_Inf;
-extern tarval *tarval_p_void;
-extern tarval *tarval_mode_null[];
-extern tarval *tarval_mode_min[];
-extern tarval *tarval_mode_max[];
+extern tarval *tarval_b_false; tarval *get_tarval_b_false ();
+extern tarval *tarval_b_true; tarval *get_tarval_b_true ();
+extern tarval *tarval_d_NaN; tarval *get_tarval_d_NaN ();
+extern tarval *tarval_d_Inf; tarval *get_tarval_d_Inf ();
+extern tarval *tarval_p_void; tarval *get_tarval_p_void ();
+extern tarval *tarval_mode_null[]; tarval *get_tarval_mode_null(ir_mode *mode);
+/* @@@ These are not initialized!! Don't use. */
+extern tarval *tarval_mode_min[]; tarval *get_tarval_mode_min (ir_mode *mode);
+extern tarval *tarval_mode_max[]; tarval *get_tarval_mode_max (ir_mode *mode);
void tarval_init_1 (void);
void tarval_init_2 (void);