Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
1140301f
Commit
1140301f
authored
Jul 15, 2010
by
Matthias Braun
Browse files
remove the unused/strange concept of a pseudo-irg
[r27740]
parent
862658eb
Changes
22
Hide whitespace changes
Inline
Side-by-side
include/libfirm/Makefile.am
View file @
1140301f
...
...
@@ -51,7 +51,6 @@ libfirminclude_HEADERS = \
irtypeinfo.h
\
irvrfy.h
\
lowering.h
\
pseudo_irg.h
\
rta.h
\
seqnumbers.h
\
structure.h
\
...
...
include/libfirm/firm.h
View file @
1140301f
...
...
@@ -107,7 +107,6 @@
#include "irtypeinfo.h"
#include "irvrfy.h"
#include "lowering.h"
#include "pseudo_irg.h"
#include "rta.h"
#include "seqnumbers.h"
#include "structure.h"
...
...
include/libfirm/iroptimize.h
View file @
1140301f
...
...
@@ -178,7 +178,7 @@ FIRM_API void escape_analysis(int run_scalar_replace,
* 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,
* Anyway, it might be good for handling builtin's
* even if the later read/write memory (but we know how).
*
* This optimizations read the irg_const_function property of
...
...
include/libfirm/irprog.h
View file @
1140301f
...
...
@@ -151,13 +151,6 @@ FIRM_API ir_graph *get_irp_irg(int pos);
/** Sets the ir graph at position pos. */
FIRM_API
void
set_irp_irg
(
int
pos
,
ir_graph
*
irg
);
/** Gets the number of graphs _and_ pseudo graphs. */
FIRM_API
int
get_irp_n_allirgs
(
void
);
/** Returns the ir graph at position pos of all graphs (including
pseudo graphs). Visits first graphs, then pseudo graphs. */
FIRM_API
ir_graph
*
get_irp_allirg
(
int
pos
);
/**
* Returns the type containing the entities for a segment.
*
...
...
include/libfirm/pseudo_irg.h
deleted
100644 → 0
View file @
862658eb
/*
* Copyright (C) 1995-2008 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 interface to pseudo irgs
* @author Goetz Lindenmaier, Boris Boesler
* @date Oktober 2004
* @version $Id$
*/
#ifndef FIRM_IR_PSEUDO_IRG_H
#define FIRM_IR_PSEUDO_IRG_H
#include "firm_types.h"
#include "begin.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.
*/
FIRM_API
ir_graph
*
new_pseudo_ir_graph
(
ir_entity
*
ent
,
int
n_loc
);
/** Returns non-zero ir ir_graph is pseudo graph.
* Is irg a pseudo graph for analysis? */
FIRM_API
int
is_pseudo_ir_graph
(
ir_graph
*
irg
);
/** Returns the number of pseudo graphs in the program. */
FIRM_API
int
get_irp_n_pseudo_irgs
(
void
);
/** Add a graph as pseudo irg */
FIRM_API
void
add_irp_pseudo_irg
(
ir_graph
*
irg
);
/** Returns the pos'th pseudo graph in the program. */
FIRM_API
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. If not set, get_entity_irg() returns
NULL if the entity refers to a pseudo irg. */
FIRM_API
void
set_visit_pseudo_irgs
(
int
x
);
FIRM_API
int
get_visit_pseudo_irgs
(
void
);
#include "end.h"
#endif
ir/Makefile.am
View file @
1140301f
...
...
@@ -177,7 +177,6 @@ libfirm_la_SOURCES = \
ir/irprog.c
\
ir/irssacons.c
\
ir/irvrfy.c
\
ir/pseudo_irg.c
\
ir/valueset.c
\
libcore/lc_appendable.c
\
libcore/lc_config_lexer.c
\
...
...
ir/ana/rta.c
View file @
1140301f
...
...
@@ -315,8 +315,6 @@ static void init_tables(void)
void
rta_init
(
void
)
{
int
n_runs
=
0
;
int
rem_vpi
=
get_visit_pseudo_irgs
();
set_visit_pseudo_irgs
(
1
);
FIRM_DBG_REGISTER
(
dbg
,
"firm.ana.rta"
);
...
...
@@ -348,8 +346,6 @@ void rta_init(void)
tr_vrfy
();
}
# endif
/* defined DEBUG_libfirm */
set_visit_pseudo_irgs
(
rem_vpi
);
}
/**
...
...
@@ -383,9 +379,6 @@ void rta_delete_dead_graphs(void)
int
i
,
n_dead_irgs
,
n_graphs
=
get_irp_n_irgs
();
ir_graph
*
irg
,
*
next_irg
,
*
dead_irgs
;
int
rem_vpi
=
get_visit_pseudo_irgs
();
set_visit_pseudo_irgs
(
1
);
irp_reserve_resources
(
irp
,
IR_RESOURCE_IRG_LINK
);
n_dead_irgs
=
0
;
...
...
@@ -410,7 +403,6 @@ void rta_delete_dead_graphs(void)
DB
((
dbg
,
LEVEL_1
,
"RTA: dead methods = %i
\n
"
,
n_dead_irgs
));
irp_free_resources
(
irp
,
IR_RESOURCE_IRG_LINK
);
set_visit_pseudo_irgs
(
rem_vpi
);
}
/* Clean up the RTA data structures. Call this after calling rta_init */
...
...
ir/be/TEMPLATE/bearch_TEMPLATE.c
View file @
1140301f
...
...
@@ -24,7 +24,6 @@
*/
#include "config.h"
#include "pseudo_irg.h"
#include "irgwalk.h"
#include "irprog.h"
#include "irprintf.h"
...
...
ir/be/amd64/bearch_amd64.c
View file @
1140301f
...
...
@@ -24,7 +24,6 @@
*/
#include "config.h"
#include "pseudo_irg.h"
#include "irgwalk.h"
#include "irprog.h"
#include "irprintf.h"
...
...
ir/be/arm/bearch_arm.c
View file @
1140301f
...
...
@@ -28,7 +28,6 @@
#include "lc_opts.h"
#include "lc_opts_enum.h"
#include "pseudo_irg.h"
#include "irgwalk.h"
#include "irprog.h"
#include "irprintf.h"
...
...
ir/be/bemain.c
View file @
1140301f
...
...
@@ -895,9 +895,6 @@ void be_main(FILE *file_handle, const char *cup_name)
}
#endif
/* never build code for pseudo irgs */
set_visit_pseudo_irgs
(
0
);
be_main_loop
(
file_handle
,
cup_name
);
if
(
be_options
.
timing
==
BE_TIME_ON
)
{
...
...
ir/be/ia32/bearch_ia32.c
View file @
1140301f
...
...
@@ -30,7 +30,6 @@
#include <math.h>
#include "pseudo_irg.h"
#include "irarch.h"
#include "irgwalk.h"
#include "irprog.h"
...
...
ir/be/sparc/bearch_sparc.c
View file @
1140301f
...
...
@@ -28,7 +28,6 @@
#include "lc_opts.h"
#include "lc_opts_enum.h"
#include "pseudo_irg.h"
#include "irgwalk.h"
#include "irprog.h"
#include "irprintf.h"
...
...
ir/common/firm.c
View file @
1140301f
...
...
@@ -154,8 +154,6 @@ void ir_finish(void)
for
(
i
=
get_irp_n_irgs
()
-
1
;
i
>=
0
;
--
i
)
free_ir_graph
(
get_irp_irg
(
i
));
for
(
i
=
get_irp_n_pseudo_irgs
()
-
1
;
i
>=
0
;
--
i
)
free_ir_graph
(
get_irp_pseudo_irg
(
i
));
free_type_entities
(
get_glob_type
());
for
(
i
=
get_irp_n_types
()
-
1
;
i
>=
0
;
--
i
)
...
...
ir/ir/irgraph_t.h
View file @
1140301f
...
...
@@ -31,7 +31,6 @@
#include "irtypes.h"
#include "irprog.h"
#include "pseudo_irg.h"
#include "type_t.h"
#include "entity_t.h"
#include "iredgekinds.h"
...
...
ir/ir/irprog.c
View file @
1140301f
...
...
@@ -31,7 +31,6 @@
#include "irprog_t.h"
#include "irgraph_t.h"
#include "irpass_t.h"
#include "pseudo_irg.h"
#include "array.h"
#include "error.h"
#include "obst.h"
...
...
@@ -58,7 +57,6 @@ static ir_prog *new_incomplete_ir_prog(void)
res
->
kind
=
k_ir_prog
;
res
->
graphs
=
NEW_ARR_F
(
ir_graph
*
,
0
);
res
->
pseudo_graphs
=
NEW_ARR_F
(
ir_graph
*
,
0
);
res
->
types
=
NEW_ARR_F
(
ir_type
*
,
0
);
res
->
modes
=
NEW_ARR_F
(
ir_mode
*
,
0
);
res
->
opcodes
=
NEW_ARR_F
(
ir_op
*
,
0
);
...
...
@@ -152,7 +150,6 @@ void free_ir_prog(void)
free_ir_graph
(
irp
->
const_code_irg
);
DEL_ARR_F
(
irp
->
graphs
);
DEL_ARR_F
(
irp
->
pseudo_graphs
);
DEL_ARR_F
(
irp
->
types
);
DEL_ARR_F
(
irp
->
modes
);
...
...
@@ -229,18 +226,6 @@ void remove_irp_irg_from_list(ir_graph *irg)
break
;
}
}
if
(
!
found
)
{
l
=
ARR_LEN
(
irp
->
pseudo_graphs
);
for
(
i
=
0
;
i
<
l
;
i
++
)
{
if
(
irp
->
pseudo_graphs
[
i
]
==
irg
)
{
for
(;
i
<
l
-
1
;
i
++
)
{
irp
->
pseudo_graphs
[
i
]
=
irp
->
pseudo_graphs
[
i
+
1
];
}
ARR_SETLEN
(
ir_graph
*
,
irp
->
pseudo_graphs
,
l
-
1
);
break
;
}
}
}
}
/* Removes irg from the list or irgs, shrinks the list by one. */
...
...
@@ -272,26 +257,6 @@ void set_irp_irg(int pos, ir_graph *irg)
irp
->
graphs
[
pos
]
=
irg
;
}
/* Gets the number of graphs _and_ pseudo graphs. */
int
get_irp_n_allirgs
(
void
)
{
/* We can not call get_irp_n_irgs, as we end up in a recursion ... */
return
ARR_LEN
(
irp
->
graphs
)
+
get_irp_n_pseudo_irgs
();
}
/* Returns the ir graph at position pos of all graphs (including
pseudo graphs). Visits first graphs, then pseudo graphs. */
ir_graph
*
get_irp_allirg
(
int
pos
)
{
int
n_irgs
=
ARR_LEN
(
irp
->
graphs
);
assert
(
0
<=
pos
);
if
(
pos
<
n_irgs
)
{
return
irp
->
graphs
[
pos
];
}
else
{
return
get_irp_pseudo_irg
(
pos
-
n_irgs
);
}
}
/* Adds type to the list of types in irp. */
void
add_irp_type
(
ir_type
*
typ
)
{
...
...
ir/ir/irprog_t.h
View file @
1140301f
...
...
@@ -29,7 +29,6 @@
#include "irprog.h"
#include "irtypes.h"
#include "pseudo_irg.h"
#include "ircgcons.h"
#include "irtypeinfo.h"
#include "irmemory.h"
...
...
@@ -63,18 +62,15 @@ static inline ir_type *_get_tls_type(void)
static
inline
int
_get_irp_n_irgs
(
void
)
{
assert
(
irp
&&
irp
->
graphs
);
if
(
get_visit_pseudo_irgs
())
return
get_irp_n_allirgs
();
return
ARR_LEN
(
irp
->
graphs
);
}
static
inline
ir_graph
*
_get_irp_irg
(
int
pos
)
{
if
(
get_visit_pseudo_irgs
())
return
get_irp_allirg
(
pos
);
assert
(
0
<=
pos
&&
pos
<=
ARR_LEN
(
irp
->
graphs
));
return
irp
->
graphs
[
pos
];
}
static
inline
int
_get_irp_n_types
(
void
)
{
assert
(
irp
&&
irp
->
types
);
...
...
ir/ir/irtypes.h
View file @
1140301f
...
...
@@ -553,7 +553,6 @@ struct ir_prog {
ir_graph
*
main_irg
;
/**< The entry point to the compiled program
or NULL if no point exists. */
ir_graph
**
graphs
;
/**< A list of all graphs in the ir. */
ir_graph
**
pseudo_graphs
;
/**< A list of all pseudo graphs in the ir. See pseudo_irg.c */
ir_graph
*
const_code_irg
;
/**< This ir graph gives the proper environment
to allocate nodes the represent values
of constant entities. It is not meant as
...
...
ir/ir/pseudo_irg.c
deleted
100644 → 0
View file @
862658eb
/*
* Copyright (C) 1995-2008 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 pseudo irg implementation
* @author Goetz Lindenmaier, Boris Boesler
* @date Oktober 2004
* @version $Id$
*/
#include "config.h"
#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
)
{
assert
(
irp
&&
irp
->
pseudo_graphs
);
return
ARR_LEN
(
irp
->
pseudo_graphs
);
}
/* Returns the pos'th pseudo graph in the program. */
ir_graph
*
get_irp_pseudo_irg
(
int
pos
)
{
assert
(
0
<=
pos
&&
pos
<=
get_irp_n_pseudo_irgs
());
return
irp
->
pseudo_graphs
[
pos
];
}
void
add_irp_pseudo_irg
(
ir_graph
*
irg
)
{
assert
(
irp
&&
irp
->
pseudo_graphs
);
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
(
ir_entity
*
ent
,
int
n_loc
)
{
ir_graph
*
res
=
new_r_ir_graph
(
ent
,
n_loc
);
add_irp_pseudo_irg
(
res
);
/* remember this graph global. */
return
res
;
}
/* Returns non-zero ir ir_graph is pseudo graph. */
int
is_pseudo_ir_graph
(
ir_graph
*
irg
)
{
int
i
,
n_pseudo_irgs
;
assert
(
irg
&&
"nothing here"
);
assert
(
is_ir_graph
(
irg
)
&&
"no ir_graph given"
);
n_pseudo_irgs
=
get_irp_n_pseudo_irgs
();
for
(
i
=
0
;
i
<
n_pseudo_irgs
;
++
i
)
{
if
(
irg
==
get_irp_pseudo_irg
(
i
))
return
1
;
}
return
0
;
}
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
;
}
ir/tr/entity_t.h
View file @
1140301f
...
...
@@ -31,7 +31,6 @@
#include "typerep.h"
#include "type_t.h"
#include "ident.h"
#include "pseudo_irg.h"
#include "compound_path.h"
typedef
struct
ir_initializer_base_t
{
...
...
@@ -345,10 +344,7 @@ static inline ir_graph *_get_entity_irg(const ir_entity *ent)
return
NULL
;
}
irg
=
ent
->
attr
.
mtd_attr
.
irg
;
if
(
irg
!=
NULL
&&
!
get_visit_pseudo_irgs
()
&&
is_pseudo_ir_graph
(
irg
))
return
NULL
;
return
irg
;
return
ent
->
attr
.
mtd_attr
.
irg
;
}
static
inline
ir_visited_t
_get_entity_visited
(
const
ir_entity
*
ent
)
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment