Commit 1ec30d95 authored by Matthias Braun's avatar Matthias Braun
Browse files

moved external headers into include dir

[r14240]
parent a0294f53
......@@ -38,12 +38,10 @@
#include "ident.h"
/**
* @typedef seqno_t
*
* An opaque type for a sequence number.
*/
#ifndef _SEQNO_T_TYPEDEF_
#define _SEQNO_T_TYPEDEF_
typedef struct sn_entry *seqno_t;
#endif
/**
* Create a new sequence number from a filename and a line number.
......
......@@ -53,11 +53,6 @@
#include "firm_types.h"
#include "irnode.h"
#ifndef _TARVAL_TYPEDEF_
#define _TARVAL_TYPEDEF_
typedef struct tarval tarval;
#endif
/* ************************ Constructors for tarvals ************************ */
/**
......
This diff is collapsed.
......@@ -698,7 +698,6 @@ is_head(ir_graph *n, ir_graph *root)
some_outof_loop = 1;
} else {
if (get_irg_uplink(pred) < get_irg_uplink(root)) {
DDMG(pred); DDMG(root);
assert(get_irg_uplink(pred) >= get_irg_uplink(root));
}
some_in_loop = 1;
......@@ -729,7 +728,6 @@ is_endless_head(ir_graph *n, ir_graph *root)
some_outof_loop = 1;
} else {
if(get_irg_uplink(pred) < get_irg_uplink(root)) {
DDMG(pred); DDMG(root);
assert(get_irg_uplink(pred) >= get_irg_uplink(root));
}
some_in_loop = 1;
......
......@@ -28,7 +28,7 @@
#endif
#include "compute_loop_info.h"
#include "strength_red.h"
#include "strength_red_t.h"
#include "tv.h"
#include "irgwalk.h"
#include "irnode_t.h"
......
......@@ -40,6 +40,7 @@
#include "irprog_t.h"
#include "entity_t.h"
#include "irgwalk.h"
#include "error.h"
#include "array.h"
......@@ -172,7 +173,8 @@ int get_type_estimated_n_fields(ir_type *tp) {
s = n_elt;
} break;
default: DDMT(tp); assert(0);
default:
panic("Unsupported type in get_type_estimated_n_fields %+F", tp);
}
return s;
......@@ -215,7 +217,7 @@ int get_type_estimated_size_bytes(ir_type *tp) {
break;
}
default: DDMT(tp); assert(0);
default: assert(0);
}
return s;
......
......@@ -41,6 +41,7 @@
#include "irdump_t.h"
#include "irdom.h"
#include "irflag.h"
#include "irprintf.h"
#include "hashptr.h"
/*------------------------------------------------------------------*/
......@@ -211,14 +212,6 @@ static int find_previous_loop(ir_loop *l, ir_loop *pred_l, ir_node *b, ir_node *
}
}
if (!found) {
DDMG(current_ir_graph);
DDML(l);
DDML(pred_l);
DDMN(b);
DDMN(pred_b);
}
return found;
}
......@@ -253,7 +246,7 @@ static void construct_interval_block(ir_node *b, ir_loop *l) {
if (is_backedge(b, i)) {
if (b != get_loop_element(l, 0).node) {
if (get_firm_verbosity()) {
printf("Loophead not at loop position 0. "); DDMN(b);
ir_printf("Loophead not at loop position 0. %+F\n", b);
}
}
/* There are no backedges in the interval decomposition. */
......@@ -284,7 +277,7 @@ static void construct_interval_block(ir_node *b, ir_loop *l) {
if (!found) {
if (b != get_loop_element(l, 0).node) {
if (get_firm_verbosity()) {
printf("Loop entry not at loop position 0. "); DDMN(b);
ir_printf("Loop entry not at loop position 0. %+F\n", b);
}
}
found = find_outer_loop(l, pred_l, pred, cfop);
......@@ -294,9 +287,6 @@ static void construct_interval_block(ir_node *b, ir_loop *l) {
found = find_previous_loop(l, pred_l, b, pred, cfop);
}
if (!found) {
DDMG(current_ir_graph);
DDMN(b);
DDMN(pred);
assert(is_backedge(b, i));
assert(found && "backedge from inner loop");
}
......@@ -305,10 +295,7 @@ static void construct_interval_block(ir_node *b, ir_loop *l) {
if (b != get_loop_element(l, 0).node) {
/* Check for improper region */
if (has_backedges(b)) {
printf("Improper Region!!!!!!\n");
DDMG(current_ir_graph);
DDMN(b);
DDML(l);
ir_fprintf(stderr, "Improper Region!!!!!! %+F\n", b);
}
}
}
......@@ -387,8 +374,7 @@ void dump_region_edges(FILE *F, void *reg) {
if (is_ir_node(reg)) {
if (get_Block_n_cfgpreds((ir_node *)reg) != get_region_n_ins(reg)) {
printf("n_cfgpreds = %d, n_ins = %d\n", get_Block_n_cfgpreds((ir_node *)reg), get_region_n_ins(reg));
DDMN((ir_node *)reg);
ir_printf("n_cfgpreds = %d, n_ins = %d\n %+F\n", get_Block_n_cfgpreds((ir_node *)reg), get_region_n_ins(reg), (ir_node*) reg);
}
}
......
......@@ -382,7 +382,6 @@ is_head (ir_node *n, ir_node *root)
some_outof_loop = 1;
} else {
if (get_irn_uplink(pred) < get_irn_uplink(root)) {
DDMN(pred); DDMN(root);
assert(get_irn_uplink(pred) >= get_irn_uplink(root));
}
some_in_loop = 1;
......@@ -419,7 +418,6 @@ is_endless_head (ir_node *n, ir_node *root)
some_outof_loop = 1; //printf(" some out of loop ");
} else {
if(get_irn_uplink(pred) < get_irn_uplink(root)) {
DDMN(pred); DDMN(root);
assert(get_irn_uplink(pred) >= get_irn_uplink(root));
}
some_in_loop = 1;
......
......@@ -46,7 +46,22 @@ typedef enum loop_flags {
once = 0x00000080, /**< this is a do loop, with a false condition.It itarate once */
} loop_flags_t;
/** The loops datastructure. */
/**
* The loops data structure.
*
* The loops data structure represents circles in the intermediate
* representation. It does not represent loops in the terms of a
* source program.
* Each ir_graph can contain one outermost loop data structure.
* loop is the entry point to the nested loops.
* The loop data structure contains a field indicating the depth of
* the loop within the nesting. Further it contains a list of the
* loops with nesting depth -1. Finally it contains a list of all
* nodes in the loop.
*
* @todo We could add a field pointing from a node to the containing loop,
* this would cost a lot of memory, though.
*/
struct ir_loop {
firm_kind kind; /**< A type tag, set to k_ir_loop. */
......
......@@ -219,8 +219,6 @@ static INLINE void free_stack(void) {
static INLINE void
push (ir_node *n)
{
/*DDMN(n);*/
if (tos == ARR_LEN (stack)) {
int nlen = ARR_LEN (stack) * 2;
ARR_RESIZE (ir_node *, stack, nlen);
......@@ -255,8 +253,6 @@ pop_scc_to_loop (ir_node *n)
do {
m = pop();
//printf(" dfn: %d, upl %d upl-new %d ", get_irn_dfn(m), get_irn_uplink(m), loop_node_cnt+1); DDMN(m);
loop_node_cnt++;
set_irn_dfn(m, loop_node_cnt);
add_loop_node(current_loop, m);
......@@ -431,8 +427,7 @@ ir_node *get_loop_node (ir_loop *loop, int pos) {
if(node_nr == pos)
return(loop -> children[child_nr].node);
}
DDML(loop);
printf("pos: %d\n", pos);
assert(0 && "no child at pos found");
return NULL;
}
......@@ -621,26 +616,6 @@ get_start_index(ir_node *n) {
#endif
}
#if 0
static void test(ir_node *pred, ir_node *root, ir_node *this) {
int i;
if (get_irn_uplink(pred) >= get_irn_uplink(root)) return;
printf("this: %d ", get_irn_uplink(this)); DDMN(this);
printf("pred: %d ", get_irn_uplink(pred)); DDMN(pred);
printf("root: %d ", get_irn_uplink(root)); DDMN(root);
printf("tos: %d\n", tos);
for (i = tos; i >= 0; i--) {
ir_node *n = stack[i];
if (!n) continue;
printf(" uplink: %d, pos: %d ", get_irn_uplink(n), i); DDMN(n);
}
}
#endif
/* Test for legal loop header: Block, Phi, ... */
static INLINE int is_possible_loop_head(ir_node *n) {
ir_op *op = get_irn_op(n);
......@@ -673,7 +648,6 @@ is_head (ir_node *n, ir_node *root)
some_outof_loop = 1;
} else {
if(get_irn_uplink(pred) < get_irn_uplink(root)) {
DDMN(n); DDMN(pred); DDMN(root);
assert(get_irn_uplink(pred) >= get_irn_uplink(root));
}
some_in_loop = 1;
......@@ -709,7 +683,6 @@ is_endless_head (ir_node *n, ir_node *root)
some_outof_loop = 1; //printf(" some out of loop ");
} else {
if(get_irn_uplink(pred) < get_irn_uplink(root)) {
DDMN(pred); DDMN(root);
assert(get_irn_uplink(pred) >= get_irn_uplink(root));
}
some_in_loop = 1;
......@@ -863,7 +836,6 @@ int search_endproj_in_stack(ir_node *start_block)
assert(is_Block(start_block));
for(i = tos - 1; i >= 0; --i)
{
DDMN(stack[i]);
if(get_irn_op(stack[i]) == op_Proj && get_irn_mode(stack[i]) == mode_X &&
get_irn_op(get_irn_n(stack[i], 0)) == op_EndReg)
{
......@@ -875,7 +847,6 @@ int search_endproj_in_stack(ir_node *start_block)
{
ir_node *begin_projx = get_Block_cfgpred(get_irg_start_block(get_irn_irg(end_projx)),
get_Proj_proj(end_projx));
DDMN(begin_projx);
if(get_irn_n(start_block, j) == begin_projx)
{
printf("FOUND IT!!!!!!!!!!!!!!!!!!\n");
......@@ -898,9 +869,6 @@ void link_to_reg_end (ir_node *n, void *env) {
ir_node *end_projx = n;
ir_node *begin_projx = get_Block_cfgpred(get_irg_start_block(get_irn_irg(end_projx)),
get_Proj_proj(end_projx));
printf("Linked the following ProjxNodes:\n");
DDMN(begin_projx);
DDMN(end_projx);
set_projx_link(begin_projx, end_projx);
}
}
......@@ -1377,7 +1345,6 @@ static int test_loop_node(ir_loop *l) {
assert(l && l->kind == k_ir_loop);
if (get_loop_n_elements(l) == 0) {
printf(" Loop completely empty! "); DDML(l);
found_problem = 1;
dump_loop(l, "-ha");
}
......@@ -1385,24 +1352,18 @@ static int test_loop_node(ir_loop *l) {
le = get_loop_element(l, 0);
if (*(le.kind) != k_ir_node) {
assert(le.kind && *(le.kind) == k_ir_loop);
printf(" First loop element is not a node! "); DDML(l);
printf(" "); DDML(le.son);
found_problem = 1;
dump_loop(l, "-ha");
}
if ((*(le.kind) == k_ir_node) && !is_possible_loop_head(le.node)) {
printf(" Wrong node as head! "); DDML(l);
printf(" "); DDMN(le.node);
found_problem = 1;
dump_loop(l, "-ha");
}
if ((get_loop_depth(l) != 0) &&
(*(le.kind) == k_ir_node) && !has_backedges(le.node)) {
printf(" Loop head has no backedges! "); DDML(l);
printf(" "); DDMN(le.node);
found_problem = 1;
dump_loop(l, "-ha");
}
......@@ -1418,7 +1379,6 @@ static int test_loop_node(ir_loop *l) {
}
if (has_node == 0) {
printf(" Loop has no firm node! "); DDML(l);
found_problem = 1;
dump_loop(l, "-ha");
}
......@@ -1432,7 +1392,6 @@ static int test_loop_node(ir_loop *l) {
*/
void find_strange_loop_nodes(ir_loop *l) {
int found_problem = 0;
printf("\nTesting loop "); DDML(l);
found_problem = test_loop_node(l);
printf("Finished Test\n\n");
if (found_problem) exit(0);
......
......@@ -43,6 +43,7 @@
#include "irgwalk.h"
#include "ident.h"
#include "trouts.h"
#include "error.h"
#define VERBOSE_UNKNOWN_TYPE(s) printf s
......@@ -396,12 +397,10 @@ default_code: {
break;
}
printf(" not implemented: "); DDMN(n);
panic(" not implemented: %+F", n);
} break; /* default */
} /* end switch */
/* printf (" found %s ", get_type_name(tp)); DDM; */
return tp;
}
......@@ -414,8 +413,6 @@ static ir_type *compute_irn_type(ir_node *n) {
set_irn_typeinfo_type(n, tp);
}
/* printf (" found %s ", get_type_name(tp)); DDM; */
return tp;
}
......
......@@ -39,9 +39,8 @@
#include "eset.h"
#include "irgwalk.h"
#include "irgmod.h"
#include "typewalk.h"
#include "irvrfy.h"
#include "trvrfy.h"
#include "irprintf.h"
# ifndef TRUE
# define TRUE 1
......@@ -108,8 +107,7 @@ static int add_graph (ir_graph *graph)
{
if (!eset_contains (_live_graphs, graph)) {
if (verbose > 1) {
fprintf(stdout, "RTA: new graph of ");
DDMEO(get_irg_entity (graph));
ir_fprintf(stdout, "RTA: new graph of %+F\n", graph);
}
eset_insert (_live_graphs, graph);
......@@ -130,8 +128,7 @@ static int add_class (ir_type *clazz)
{
if (!eset_contains (_live_classes, clazz)) {
if (verbose > 1) {
fprintf(stdout, "RTA: new class: ");
DDMT(clazz);
ir_fprintf(stdout, "RTA: new class: %+F\n", clazz);
}
eset_insert (_live_classes, clazz);
......@@ -158,8 +155,7 @@ static int add_implementing_graphs (ir_entity *method)
}
if (verbose > 1) {
fprintf(stdout, "RTA: new call to ");
DDMEO(method);
ir_fprintf(stdout, "RTA: new call to %+F\n", method);
}
if (rta_is_alive_class (get_entity_owner (method))) {
......@@ -220,7 +216,6 @@ static void rta_act (ir_node *node, void *env)
/* STRANGE */
} else {
DDMN(ptr);
assert(0 && "Unexpected address expression: can not analyse, therefore can not do correct rta!");
}
......@@ -289,8 +284,8 @@ static int rta_fill_incremental (void)
graph = eset_next (live_graphs)) {
if (verbose > 1) {
fprintf(stdout, "RTA: RUN %i: considering graph of ", n_runs);
DDMEO(get_irg_entity (graph));
ir_fprintf(stdout, "RTA: RUN %i: considering graph of %+F\n", n_runs,
graph);
}
rerun |= rta_fill_graph (graph);
......@@ -558,14 +553,13 @@ void rta_report (void)
for (i = 0; i < get_irp_n_types(); ++i) {
ir_type *tp = get_irp_type(i);
if (is_Class_type(tp) && rta_is_alive_class(tp)) {
fprintf(stdout, "RTA: considered allocated: "); DDMT(tp);
ir_fprintf(stdout, "RTA: considered allocated: %+F\n", tp);
}
}
for (i = 0; i < get_irp_n_irgs(); i++) {
if (rta_is_alive_graph (get_irp_irg(i))) {
fprintf(stdout, "RTA: considered called: graph of ");
DDMEO(get_irg_entity (get_irp_irg(i)));
ir_fprintf(stdout, "RTA: considered called: graph of %+F\n", get_irp_irg(i));
}
}
}
......
#
# Project: libFIRM
# File name: ir/ana/Makefile.in
# Purpose:
# Author: Boris Boesler, Till Riedel
# Modified by:
# Created:
# CVS-ID: $Id$
# Copyright: (c) 1999-2003 Universitt Karlsruhe
# Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
#
top_srcdir := @top_srcdir@
srcdir = @srcdir@
topdir = ../..
subdir := ir/ana2
INSTALL_HEADERS = ecg.h irmemwalk.h lset.h typalise.h pto.h pto_comp.h \
pto_ctx.h pto_debug.h pto_init.h pto_name.h pto_util.h pto_mod.h \
qset.h gnu_ext.h
SOURCES = $(INSTALL_HEADERS)
SOURCES += Makefile.in \
ecg.c irmemwalk.c lset.c typalise.c \
pto.c \
pto_comp.c pto_ctx.c pto_debug.c pto_init.c pto_name.c pto_util.c \
pto_mod.c \
qset.c
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 \
-I$(top_srcdir)/ir/debug -I$(top_srcdir)/ir/ana -I$(top_srcdir)/ir/st \
-I$(top_srcdir)/ir/opt -I$(top_srcdir)/ir/arch -I$(top_srcdir)/ir/stat \
-I$(top_srcdir)/ir/external -I$(topdir)/ir/config -I$(top_srcdir)/ir/arch
include $(top_srcdir)/MakeTargets
all: subdir.o
This diff is collapsed.
/*
* Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
* This file may be distributed and/or modified under the terms of the
* GNU General Public License version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* Licensees holding valid libFirm Professional Edition licenses may use
* this file in accordance with the libFirm Commercial License.
* Agreement provided with the Software.
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE.
*/
/**
* @file
* @brief Extended Call Graph
* @author Florian
* @version $Id$
*/
#ifndef FIRM_ANA2_EGC_H
#define FIRM_ANA2_EGC_H
# include "irgraph.h"
# include "irnode.h"
/*
data
*/
typedef struct ctx_info
{
ir_graph *graph; /* The graph of the callR who created this ctx */
/* (which is redundant, since it's always == get_irn_graph (call) */
ir_node *call; /* The call through which this graph was called */
struct ctx_info *enc; /* The ctx in which our callR was called */
int id;
} ctx_info_t;
typedef struct alloc_info
{
ir_graph *graph;
ir_node *alloc;
ir_type *tp;
struct alloc_info *prev;
} alloc_info_t;
typedef struct callEd_info
{
ir_graph *callEd;
struct callEd_info *prev;
} callEd_info_t;
typedef struct call_info
{
ir_node *call;
callEd_info_t *callEds;
struct call_info *prev;
} call_info_t;
typedef struct graph_info
{
ir_graph *graph;
call_info_t *calls;
alloc_info_t *allocs;
ctx_info_t **ctxs;
int n_ctxs;
int ecg_seen;
int allocs_seen;
struct graph_info *prev;
} graph_info_t;
typedef void graph_hnd_t (graph_info_t*, void*);
typedef void alloc_hnd_t (alloc_info_t*, void*);
typedef void call_hnd_t (call_info_t*, void*);
typedef void callEd_hnd_t (callEd_info_t*, void*);
/* protos */
void ecg_print_ctx (ctx_info_t*, FILE *stream);
ctx_info_t *get_ctx (graph_info_t*, int);
ctx_info_t *get_main_ctx (void);
void ecg_iterate_graphs (graph_hnd_t*, void*);
void ecg_iterate_allocs (graph_info_t*, alloc_hnd_t*, void*);
void ecg_iterate_calls (graph_info_t*, call_hnd_t*, void*);
void ecg_iterate_callEds (call_info_t*, callEd_hnd_t*, void*);
graph_info_t *ecg_get_info (ir_graph*);
alloc_info_t *ecg_get_alloc_info (ir_graph*);
callEd_info_t *ecg_get_callEd_info (ir_node*);
void ecg_init (int);
void ecg_cleanup (void);
void ecg_report (void);
void ecg_ecg (void);
#endif /* defined _EGC_H_ */
/*
$Log$
Revision 1.4 2006/01/13 22:00:15 beck
renamed all types 'type' to 'ir_type'
Revision 1.3 2004/11/20 21:20:29 liekweg
Added iterator functions
Revision 1.2 2004/11/18 16:36:37 liekweg
Added unique ids for debugging, added access functions
Revision 1.1 2004/10/20 14:59:42 liekweg
Added ana2, added ecg and pto
Revision 1.3 2004/10/14 11:31:29 liekweg
SHUTUP_GCC
Revision 1.2 2004/10/12 11:02:03 liekweg
wtf?
Revision 1.1 2004/09/29 12:03:39 liekweg
Added ecg mod
*/
/* -*- c -*- */
/*
* Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
* This file may be distributed and/or modified under the terms of the
* GNU General Public License version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* Licensees holding valid libFirm Professional Edition licenses may use
* this file in accordance with the libFirm Commercial License.