topdir = ../..
subdir := ir/external
-INSTALL_HEADERS = read.h
+INSTALL_HEADERS = read.h pseudo_irg.h
SOURCES = $(INSTALL_HEADERS)
SOURCES += Makefile.in \
- read.c
+ read.c pseudo_irg.c
include $(topdir)/MakeRules
--- /dev/null
+
+
+#include "pseudo_irg.h"
+
+#include "irgraph_t.h"
+#include "irprog_t.h"
+#include "array.h"
+
+
+/** Returns the number of pseudo graphs in the program. */
+int get_irp_n_pseudo_irgs(void) {
+ return ARR_LEN(irp->pseudo_graphs);
+}
+
+/** Returns the number of pseudo graphs in the program. */
+ir_graph *get_irp_pseudo_irg(int pos) {
+ return irp->pseudo_graphs[pos];
+}
+
+void add_irp_pseudo_irg(ir_graph *irg) {
+ ARR_APP1(ir_graph *, irp->pseudo_graphs, irg);
+}
+
+
+/* Create a new ir graph to build a pseudo representation of a procedure.
+ *
+ * The pseudo representation can only be used for analyses. It may not be
+ * optimized. Pseudo graphs are kept in a separate graph list in irprog.
+ */
+ir_graph *
+new_pseudo_ir_graph(entity *ent, int n_loc) {
+ ir_graph *res = new_r_ir_graph (ent, n_loc);
+ add_irp_irg(res); /* remember this graph global. */
+ return res;
+}
+
+/** Returns true ir ir_graph is pseudo graph. */
+int is_pseudo_ir_graph(ir_graph *irg)
+{
+ assert(irg && "nothing here");
+ assert(is_ir_graph(irg) && "no ir_graph given");
+
+ int i, n_pseudo_irgs = get_irp_n_pseudo_irgs();
+ for (i = 0; i < n_pseudo_irgs; ++i) {
+ if (irg == get_irp_pseudo_irg(i)) return true;
+ }
+ return false;
+}
+
+static int visit_pseudo_irgs = 0;
+
+void set_visit_pseudo_irgs(int x) {
+ visit_pseudo_irgs = x;
+}
+
+int get_visit_pseudo_irgs(void) {
+ return visit_pseudo_irgs;
+}
--- /dev/null
+
+#include "entity.h"
+#include "irgraph.h"
+
+
+/** Create a new ir graph to build a pseudo representation of a procedure.
+ *
+ * The pseudo representation can only be used for analyses. It may not be
+ * optimized. Pseudo graphs are kept in a separate graph list in irprog.
+ */
+ir_graph *new_pseudo_ir_graph(entity *ent, int n_loc);
+
+/** Returns true ir ir_graph is pseudo graph.
+ * Is irg a pseudo graph for analysis? */
+int is_pseudo_ir_graph(ir_graph *irg);
+
+/** Returns the number of pseudo graphs in the program. */
+int get_irp_n_pseudo_irgs(void);
+
+/** Returns the number of pseudo graphs in the program. */
+ir_graph *get_irp_pseudo_irg(int pos);
+
+
+/** If set, get_irp_n_irgs and get_irp_irg behave as if all
+ pseudo graphs are in the irg list. */
+void set_visit_pseudo_irgs(int x);
+int get_visit_pseudo_irgs(void);
#include "read.h"
#include "irprog.h"
#include "irgraph.h"
+#include "pseudo_irg.h"
#include "ircons.h"
#include "irmode.h"
#include "irdump.h"
&& peculiarity_existent == get_entity_peculiarity(fent)
&& "not an abstract entity");
/* create irg in entity */
- irg = new_ir_graph(fent, 0);
+ irg = new_pseudo_ir_graph(fent, 0);
set_irg_inline_property(irg, irg_inline_forbidden);
+ /* If the spec says so: */
+ set_entity_visibility(fent, visibility_local);
+
VERBOSE_PRINT((stdout, "create effects for %s\n",
get_id_str(proc -> proc_ident)));
modules = NULL;
}
+
+void free_abstraction(void) {
+ int i, n_pseudo_irgs = get_irp_n_pseudo_irgs();
+ for (i = 0; i < n_pseudo_irgs; ++i) {
+ ir_graph *p_irg = get_irp_pseudo_irg(i);
+ set_entity_visibility(get_irg_entity(p_irg), visibility_external_allocated);
+ // @@@ free_pseudo_ir_graph(p_irg);
+ }
+}
+
+
/********************************************************************/
\f
/*
* $Log$
+ * Revision 1.15 2004/11/11 09:28:32 goetz
+ * treat pseudo irgs special
+ * parse 'local' from xml files
+ *
* Revision 1.14 2004/11/10 14:42:00 boesler
* be more helpful if a method does not exist
*
/** read the file and build the graphs */
void create_abstraction(const char *filename);
+void free_abstraction(void);
+
#endif /* defined _READ_H_ */
/*
$Log$
+ Revision 1.8 2004/11/11 09:28:32 goetz
+ treat pseudo irgs special
+ parse 'local' from xml files
+
Revision 1.7 2004/10/25 13:52:24 boesler
seperated read.h (public interface) and read_t.h (types)