Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
319f6c78
Commit
319f6c78
authored
Feb 14, 2014
by
Christoph Mallon
Browse files
Remove the unused typeinfo map.
parent
f40a8239
Changes
16
Hide whitespace changes
Inline
Side-by-side
include/libfirm/Makefile.am
View file @
319f6c78
...
...
@@ -40,7 +40,6 @@ libfirminclude_HEADERS = \
irouts.h
\
irprintf.h
\
irprog.h
\
irtypeinfo.h
\
irverify.h
\
lowering.h
\
nodeops.h
\
...
...
include/libfirm/firm.h
View file @
319f6c78
...
...
@@ -103,7 +103,6 @@
#include
"irouts.h"
#include
"irprintf.h"
#include
"irprog.h"
#include
"irtypeinfo.h"
#include
"irverify.h"
#include
"lowering.h"
#include
"timing.h"
...
...
include/libfirm/irdump.h
View file @
319f6c78
...
...
@@ -273,8 +273,6 @@ typedef enum {
ir_dump_flag_loops
=
1U
<<
10
,
/** if set (and backedge info is computed) dump backedges */
ir_dump_flag_back_edges
=
1U
<<
11
,
/** dump type info from ana/irtypeinfo.h in the node labels */
ir_dump_flag_analysed_types
=
1U
<<
12
,
/** dump backedges from iredges.h */
ir_dump_flag_iredges
=
1U
<<
13
,
/** write node addresses into the vcg info */
...
...
include/libfirm/irtypeinfo.h
deleted
100644 → 0
View file @
f40a8239
/*
* This file is part of libFirm.
* Copyright (C) 2012 University of Karlsruhe.
*/
/**
* @file
* @brief Data structure to hold type information for nodes.
* @author Goetz Lindenmaier
* @date 28.8.2003
* @brief
* Data structure to hold type information for nodes.
*
* This module defines a field "type" of type "type *" for each ir node.
* It defines a flag for irgraphs to mark whether the type info of the
* graph is valid. Further it defines an auxiliary type "init_type".
*/
#ifndef FIRM_ANA_IRTYPEINFO_H
#define FIRM_ANA_IRTYPEINFO_H
#include
"firm_types.h"
#include
"begin.h"
/* ------------ Auxiliary type. --------------------------------------- */
/** An auxiliary type used to express that a field is uninitialized.
*
* This auxiliary type expresses that a field is uninitialized. The
* variable is initialized by init_irtypeinfo(). The type is freed by
* free_irtypeinfo().
*/
FIRM_API
ir_type
*
initial_type
;
/* ------------ Initializing this module. ----------------------------- */
/** Initializes the type information module.
*
* Initializes the type information module.
* Generates a type inititial_type and sets the type of all nodes to this type.
* Calling set/get_irn_typeinfo_type() is invalid before calling init. Requires memory
* in the order of MIN(\<calls to set_irn_typeinfo_type\>, \#irnodes).
*/
FIRM_API
void
init_irtypeinfo
(
void
);
/** Frees memory used by the type information module */
FIRM_API
void
free_irtypeinfo
(
void
);
/* ------------ Irgraph state handling. ------------------------------- */
/** typeinfo information state */
typedef
enum
{
ir_typeinfo_none
,
/**< No typeinfo computed, calls to set/get_irn_typeinfo_type()
are invalid. */
ir_typeinfo_consistent
,
/**< Type info valid, calls to set/get_irn_typeinfo_type() return
the proper type. */
ir_typeinfo_inconsistent
/**< Type info can be accessed, but it can be invalid
because of other transformations. */
}
ir_typeinfo_state
;
/** Sets state of typeinfo information in graph @p irg to @p state. */
FIRM_API
void
set_irg_typeinfo_state
(
ir_graph
*
irg
,
ir_typeinfo_state
state
);
/** Returns state of typeinfo information in graph @p irg. */
FIRM_API
ir_typeinfo_state
get_irg_typeinfo_state
(
const
ir_graph
*
irg
);
/** Returns accumulated type information state information.
*
* Returns ir_typeinfo_consistent if the type information of all irgs is
* consistent. Returns ir_typeinfo_inconsistent if at least one irg has inconsistent
* or no type information. Returns ir_typeinfo_none if no irg contains type information.
*/
FIRM_API
ir_typeinfo_state
get_irp_typeinfo_state
(
void
);
/** Sets state of typeinfo information for the current program to @p state */
FIRM_API
void
set_irp_typeinfo_state
(
ir_typeinfo_state
state
);
/** Sets state of typeinfo information for the current program to #ir_typeinfo_inconsistent */
FIRM_API
void
set_irp_typeinfo_inconsistent
(
void
);
/* ------------ Irnode type information. ------------------------------ */
/** Accessing the type information.
*
* These routines only work properly if the ir_graph is in state
* ir_typeinfo_consistent or ir_typeinfo_inconsistent.
*/
FIRM_API
ir_type
*
get_irn_typeinfo_type
(
const
ir_node
*
n
);
/** Sets type information of procedure graph node @p node to type @p type. */
FIRM_API
void
set_irn_typeinfo_type
(
ir_node
*
node
,
ir_type
*
type
);
#include
"end.h"
#endif
ir/Makefile.am
View file @
319f6c78
...
...
@@ -58,7 +58,6 @@ libfirm_la_SOURCES = \
ana/irmemory.c
\
ana/irouts.c
\
ana/irscc.c
\
ana/irtypeinfo.c
\
ana/trouts.c
\
ana/vrp.c
\
be/beabi.c
\
...
...
ir/ana/irtypeinfo.c
deleted
100644 → 0
View file @
f40a8239
/*
* This file is part of libFirm.
* Copyright (C) 2012 University of Karlsruhe.
*/
/**
* @file
* @brief Data structure to hold type information for nodes.
* @author Goetz Lindenmaier
* @date 28.8.2003
* @brief
* Data structure to hold type information for nodes.
*
* This module defines a field "type" of type "type *" for each ir node.
* It defines a flag for irgraphs to mark whether the type info of the
* graph is valid. Further it defines an auxiliary type "initial_type".
*
* The module defines a map that contains pairs (irnode, type). If an irnode
* is not in the map it is assumed to be initialized, i.e., the initialization
* requires no compute time. As firm nodes can not be freed and reallocated
* pointers for nodes are unique (until a call of dead_node_elimination).
*/
#include
"irtypeinfo.h"
#include
<stddef.h>
#include
"irgraph_t.h"
#include
"irprog_t.h"
#include
"irnode_t.h"
#include
"pmap.h"
static
pmap
*
type_node_map
=
NULL
;
ir_type
*
initial_type
=
NULL
;
void
init_irtypeinfo
(
void
)
{
if
(
initial_type
==
NULL
)
initial_type
=
new_type_class
(
new_id_from_str
(
"initial_type"
));
/* We need a new, empty map. */
if
(
type_node_map
!=
NULL
)
pmap_destroy
(
type_node_map
);
type_node_map
=
pmap_create
();
for
(
size_t
i
=
0
,
n
=
get_irp_n_irgs
();
i
<
n
;
++
i
)
set_irg_typeinfo_state
(
get_irp_irg
(
i
),
ir_typeinfo_none
);
}
void
free_irtypeinfo
(
void
)
{
if
(
initial_type
!=
NULL
)
{
free_type
(
initial_type
);
initial_type
=
NULL
;
}
if
(
type_node_map
!=
NULL
)
{
pmap_destroy
(
type_node_map
);
type_node_map
=
NULL
;
}
for
(
size_t
i
=
0
,
n
=
get_irp_n_irgs
();
i
<
n
;
++
i
)
set_irg_typeinfo_state
(
get_irp_irg
(
i
),
ir_typeinfo_none
);
}
void
set_irg_typeinfo_state
(
ir_graph
*
irg
,
ir_typeinfo_state
s
)
{
assert
(
is_ir_graph
(
irg
));
irg
->
typeinfo_state
=
s
;
if
((
irg
->
typeinfo_state
==
ir_typeinfo_consistent
)
&&
(
irp
->
typeinfo_state
==
ir_typeinfo_consistent
)
&&
(
s
!=
ir_typeinfo_consistent
)
)
irp
->
typeinfo_state
=
ir_typeinfo_inconsistent
;
}
ir_typeinfo_state
get_irg_typeinfo_state
(
const
ir_graph
*
irg
)
{
assert
(
is_ir_graph
(
irg
));
return
irg
->
typeinfo_state
;
}
ir_typeinfo_state
get_irp_typeinfo_state
(
void
)
{
return
irp
->
typeinfo_state
;
}
void
set_irp_typeinfo_state
(
ir_typeinfo_state
s
)
{
irp
->
typeinfo_state
=
s
;
}
void
set_irp_typeinfo_inconsistent
(
void
)
{
if
(
irp
->
typeinfo_state
==
ir_typeinfo_consistent
)
irp
->
typeinfo_state
=
ir_typeinfo_inconsistent
;
}
ir_type
*
get_irn_typeinfo_type
(
const
ir_node
*
n
)
{
assert
(
get_irg_typeinfo_state
(
get_irn_irg
(
n
))
!=
ir_typeinfo_none
);
ir_type
*
res
=
pmap_get
(
ir_type
,
type_node_map
,
n
);
if
(
res
==
NULL
)
{
res
=
initial_type
;
}
return
res
;
}
void
set_irn_typeinfo_type
(
ir_node
*
n
,
ir_type
*
tp
)
{
assert
(
get_irg_typeinfo_state
(
get_irn_irg
(
n
))
!=
ir_typeinfo_none
);
pmap_insert
(
type_node_map
,
(
void
*
)
n
,
(
void
*
)
tp
);
}
ir/ir/irdump.c
View file @
319f6c78
...
...
@@ -168,7 +168,6 @@ static ir_dump_flags_t flags =
ir_dump_flag_ld_names
|
ir_dump_flag_back_edges
|
ir_dump_flag_consts_local
|
ir_dump_flag_analysed_types
|
ir_dump_flag_entities_in_hierarchy
|
ir_dump_flag_number_label
;
...
...
@@ -776,22 +775,6 @@ static void dump_node_mode(FILE *F, const ir_node *n)
}
}
/**
* Dump the type of a node n to a file F if it's known.
*/
static
void
dump_node_typeinfo
(
FILE
*
F
,
const
ir_node
*
n
)
{
ir_graph
*
irg
=
get_irn_irg
(
n
);
if
(
ir_get_dump_flags
()
&
ir_dump_flag_analysed_types
)
{
if
(
get_irg_typeinfo_state
(
irg
)
==
ir_typeinfo_consistent
||
get_irg_typeinfo_state
(
irg
)
==
ir_typeinfo_inconsistent
)
{
ir_type
*
tp
=
get_irn_typeinfo_type
(
n
);
ir_fprintf
(
F
,
"[%+F]"
,
tp
);
}
}
}
/**
* Dump additional node attributes of some nodes to a file F.
*/
...
...
@@ -869,7 +852,6 @@ void dump_node_label(FILE *F, const ir_node *n)
fputs
(
" "
,
F
);
dump_node_mode
(
F
,
n
);
fprintf
(
F
,
" "
);
dump_node_typeinfo
(
F
,
n
);
dump_node_nodeattr
(
F
,
n
);
if
(
flags
&
ir_dump_flag_number_label
)
{
fprintf
(
F
,
"%ld"
,
get_irn_node_nr
(
n
));
...
...
ir/ir/irdumptxt.c
View file @
319f6c78
...
...
@@ -97,8 +97,6 @@ void dump_irnode_to_file(FILE *const F, const ir_node *const n)
fprintf
(
F
,
" %ld
\n
"
,
get_irn_node_nr
(
n
));
fprintf
(
F
,
" index: %u
\n
"
,
get_irn_idx
(
n
));
if
(
ir_get_dump_flags
()
&
ir_dump_flag_analysed_types
)
fprintf
(
F
,
" addr: %p
\n
"
,
(
void
*
)
n
);
fprintf
(
F
,
" mode: %s
\n
"
,
get_mode_name
(
get_irn_mode
(
n
)));
fprintf
(
F
,
" visited: %lu
\n
"
,
get_irn_visited
(
n
));
ir_graph
*
irg
=
get_irn_irg
(
n
);
...
...
@@ -334,11 +332,6 @@ void dump_irnode_to_file(FILE *const F, const ir_node *const n)
default:
break
;
}
if
(
get_irg_typeinfo_state
(
get_irn_irg
(
n
))
==
ir_typeinfo_consistent
||
get_irg_typeinfo_state
(
get_irn_irg
(
n
))
==
ir_typeinfo_inconsistent
)
{
ir_fprintf
(
F
,
" Analysed type: %s
\n
"
,
get_irn_typeinfo_type
(
n
));
}
}
void
dump_graph_as_text
(
FILE
*
const
out
,
const
ir_graph
*
const
irg
)
...
...
ir/ir/irgraph.c
View file @
319f6c78
...
...
@@ -119,8 +119,6 @@ static ir_graph *new_r_ir_graph(ir_entity *ent, int n_loc)
irg_set_nloc
(
res
,
n_loc
);
res
->
irg_pinned_state
=
op_pin_state_pinned
;
res
->
typeinfo_state
=
ir_typeinfo_none
;
set_irp_typeinfo_inconsistent
();
/* there is a new graph with typeinfo_none. */
res
->
callee_info_state
=
irg_callee_info_none
;
res
->
mem_disambig_opt
=
aa_opt_inherited
;
...
...
ir/ir/irprog_t.h
View file @
319f6c78
...
...
@@ -14,7 +14,6 @@
#include
"irprog.h"
#include
"irtypes.h"
#include
"irtypeinfo.h"
#include
"irmemory.h"
#include
"callgraph.h"
...
...
ir/ir/irtypes.h
View file @
319f6c78
...
...
@@ -19,7 +19,6 @@
#include
"irnode.h"
#include
"iredgekinds.h"
#include
"irop.h"
#include
"irtypeinfo.h"
#include
"irmemory.h"
#include
"callgraph.h"
#include
"irprog.h"
...
...
@@ -496,7 +495,6 @@ struct ir_graph {
ir_graph_properties_t
properties
;
ir_graph_constraints_t
constraints
;
op_pin_state
irg_pinned_state
;
/**< Flag for status of nodes. */
ir_typeinfo_state
typeinfo_state
;
/**< Validity of typeinfo. */
irg_callee_info_state
callee_info_state
;
/**< Validity of callee information. */
/* -- Helpers for walking/analysis of the graph -- */
...
...
@@ -589,7 +587,6 @@ struct ir_prog {
irg_callee_info_state
callee_info_state
;
/**< Validity of callee information.
Contains the lowest value or all irgs. */
ir_typeinfo_state
typeinfo_state
;
/**< Validity of type information. */
inh_transitive_closure_state
inh_trans_closure_state
;
/**< State of transitive closure
of inheritance relations. */
...
...
vc2005/libfirm.vcproj
View file @
319f6c78
...
...
@@ -7011,37 +7011,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=
"..\ir\ana\irtypeinfo.c"
>
<FileConfiguration
Name=
"Release|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
AdditionalIncludeDirectories=
""
PreprocessorDefinitions=
""
/>
</FileConfiguration>
<FileConfiguration
Name=
"Debug|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
AdditionalIncludeDirectories=
""
PreprocessorDefinitions=
""
/>
</FileConfiguration>
<FileConfiguration
Name=
"DebugJTEST|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
AdditionalIncludeDirectories=
""
PreprocessorDefinitions=
""
/>
</FileConfiguration>
</File>
<File
RelativePath=
"..\ir\ana\Makefile.in"
>
...
...
@@ -7368,10 +7337,6 @@
RelativePath=
"..\include\libfirm\irsimpletype.h"
>
</File>
<File
RelativePath=
"..\include\libfirm\irtypeinfo.h"
>
</File>
<File
RelativePath=
"..\include\libfirm\irvrfy.h"
>
...
...
win32/header.list
View file @
319f6c78
...
...
@@ -59,7 +59,6 @@ ir\ana\irdom.h
ir\ana\cgana.h
ir\ana\compute_loop_info.h
ir\ana\irloop.h
ir\ana\irtypeinfo.h
ir\ana\irsimpletype.h
ir\ana\callgraph.h
ir\ana\rta.h
...
...
win32/libfirm.dsp
View file @
319f6c78
...
...
@@ -291,10 +291,6 @@ SOURCE=..\ir\ana\irsimpletype.c
# End Source File
# Begin Source File
SOURCE=..\ir\ana\irtypeinfo.c
# End Source File
# Begin Source File
SOURCE=..\ir\ana\phiclass.c
# End Source File
# Begin Source File
...
...
@@ -2816,10 +2812,6 @@ SOURCE=..\include\libfirm\irsimpletype.h
# End Source File
# Begin Source File
SOURCE=..\include\libfirm\irtypeinfo.h
# End Source File
# Begin Source File
SOURCE=..\include\libfirm\irvrfy.h
# End Source File
# Begin Source File
...
...
win32/vc2010/firm.vcxproj
View file @
319f6c78
...
...
@@ -159,7 +159,6 @@
<ClCompile
Include=
"$(FirmRoot)\ir\ana\irmemory.c"
/>
<ClCompile
Include=
"$(FirmRoot)\ir\ana\rta.c"
/>
<ClCompile
Include=
"$(FirmRoot)\ir\ana\vrp.c"
/>
<ClCompile
Include=
"$(FirmRoot)\ir\ana\irtypeinfo.c"
/>
<ClCompile
Include=
"$(FirmRoot)\ir\ana\structure.c"
/>
<ClCompile
Include=
"$(FirmRoot)\ir\ana\trouts.c"
/>
<ClInclude
Include=
"$(FirmRoot)\ir\ana\absgraph.h"
/>
...
...
@@ -510,7 +509,6 @@
<ClInclude
Include=
"$(FirmRoot)\include\libfirm\irprintf.h"
/>
<ClInclude
Include=
"$(FirmRoot)\include\libfirm\timing.h"
/>
<ClInclude
Include=
"$(FirmRoot)\include\libfirm\nodeops.h"
/>
<ClInclude
Include=
"$(FirmRoot)\include\libfirm\irtypeinfo.h"
/>
<ClInclude
Include=
"$(FirmRoot)\include\libfirm\irverify.h"
/>
<ClInclude
Include=
"$(FirmRoot)\include\libfirm\lowering.h"
/>
<ClInclude
Include=
"$(FirmRoot)\include\libfirm\typerep.h"
/>
...
...
win32/vc2010/firm.vcxproj.filters
View file @
319f6c78
...
...
@@ -213,9 +213,6 @@
<ClCompile
Include=
"$(FirmRoot)\ir\ana\irsimpletype.c"
>
<Filter>
ir\ana
</Filter>
</ClCompile>
<ClCompile
Include=
"$(FirmRoot)\ir\ana\irtypeinfo.c"
>
<Filter>
ir\ana
</Filter>
</ClCompile>
<ClCompile
Include=
"$(FirmRoot)\ir\ana\rta.c"
>
<Filter>
ir\ana
</Filter>
</ClCompile>
...
...
@@ -1305,9 +1302,6 @@
<ClInclude
Include=
"$(FirmRoot)\include\libfirm\irsimpletype.h"
>
<Filter>
include\libfirm
</Filter>
</ClInclude>
<ClInclude
Include=
"$(FirmRoot)\include\libfirm\irtypeinfo.h"
>
<Filter>
include\libfirm
</Filter>
</ClInclude>
<ClInclude
Include=
"$(FirmRoot)\include\libfirm\irvrfy.h"
>
<Filter>
include\libfirm
</Filter>
</ClInclude>
...
...
@@ -2040,9 +2034,6 @@
<ClCompile
Include=
"$(FirmRoot)\ir\ana\vrp.c"
>
<Filter>
ir\ana
</Filter>
</ClCompile>
<ClCompile
Include=
"$(FirmRoot)\ir\ana\irtypeinfo.c"
>
<Filter>
ir\ana
</Filter>
</ClCompile>
<ClCompile
Include=
"$(FirmRoot)\ir\ana\structure.c"
>
<Filter>
ir\ana
</Filter>
</ClCompile>
...
...
@@ -3096,9 +3087,6 @@
<ClInclude
Include=
"$(FirmRoot)\include\libfirm\nodeops.h"
>
<Filter>
include\libfirm
</Filter>
</ClInclude>
<ClInclude
Include=
"$(FirmRoot)\include\libfirm\irtypeinfo.h"
>
<Filter>
include\libfirm
</Filter>
</ClInclude>
<ClInclude
Include=
"$(FirmRoot)\include\libfirm\irverify.h"
>
<Filter>
include\libfirm
</Filter>
</ClInclude>
...
...
@@ -3711,9 +3699,6 @@
<ClCompile
Include=
"$(FirmRoot)\ir\ana\vrp.c"
>
<Filter>
ir\ana
</Filter>
</ClCompile>
<ClCompile
Include=
"$(FirmRoot)\ir\ana\irtypeinfo.c"
>
<Filter>
ir\ana
</Filter>
</ClCompile>
<ClCompile
Include=
"$(FirmRoot)\ir\ana\structure.c"
>
<Filter>
ir\ana
</Filter>
</ClCompile>
...
...
@@ -4767,9 +4752,6 @@
<ClInclude
Include=
"$(FirmRoot)\include\libfirm\nodeops.h"
>
<Filter>
include\libfirm
</Filter>
</ClInclude>
<ClInclude
Include=
"$(FirmRoot)\include\libfirm\irtypeinfo.h"
>
<Filter>
include\libfirm
</Filter>
</ClInclude>
<ClInclude
Include=
"$(FirmRoot)\include\libfirm\irverify.h"
>
<Filter>
include\libfirm
</Filter>
</ClInclude>
...
...
@@ -5376,9 +5358,6 @@
<ClCompile
Include=
"$(FirmRoot)\ir\ana\vrp.c"
>
<Filter>
ir\ana
</Filter>
</ClCompile>
<ClCompile
Include=
"$(FirmRoot)\ir\ana\irtypeinfo.c"
>
<Filter>
ir\ana
</Filter>
</ClCompile>
<ClCompile
Include=
"$(FirmRoot)\ir\ana\structure.c"
>
<Filter>
ir\ana
</Filter>
</ClCompile>
...
...
@@ -6429,9 +6408,6 @@
<ClInclude
Include=
"$(FirmRoot)\include\libfirm\nodeops.h"
>
<Filter>
include\libfirm
</Filter>
</ClInclude>
<ClInclude
Include=
"$(FirmRoot)\include\libfirm\irtypeinfo.h"
>
<Filter>
include\libfirm
</Filter>
</ClInclude>
<ClInclude
Include=
"$(FirmRoot)\include\libfirm\irverify.h"
>
<Filter>
include\libfirm
</Filter>
</ClInclude>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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