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
c3e48b15
Commit
c3e48b15
authored
Nov 19, 2007
by
Michael Beck
Browse files
moved be_retrieve_dbg_info() into middleend and rename it to ir_retrieve_dbg_info()
[r16804]
parent
ce14b8c8
Changes
8
Hide whitespace changes
Inline
Side-by-side
include/libfirm/be.h
View file @
c3e48b15
...
@@ -83,21 +83,6 @@ const backend_params *be_init(void);
...
@@ -83,21 +83,6 @@ const backend_params *be_init(void);
*/
*/
void
be_main
(
FILE
*
file_handle
,
const
char
*
cup_name
);
void
be_main
(
FILE
*
file_handle
,
const
char
*
cup_name
);
/** The type of the debug info retriever function. */
typedef
const
char
*
(
*
retrieve_dbg_func
)(
const
dbg_info
*
dbg
,
unsigned
*
line
);
/**
* Sets a debug info retriever.
*
* @param func the debug retriever function.
*/
void
be_set_debug_retrieve
(
retrieve_dbg_func
func
);
/**
* Retrieve the debug info.
*/
const
char
*
be_retrieve_dbg_info
(
const
dbg_info
*
dbg
,
unsigned
*
line
);
typedef
struct
be_main_env_t
be_main_env_t
;
typedef
struct
be_main_env_t
be_main_env_t
;
typedef
struct
be_options_t
be_options_t
;
typedef
struct
be_options_t
be_options_t
;
...
...
include/libfirm/dbginfo.h
View file @
c3e48b15
...
@@ -195,6 +195,21 @@ void default_dbg_info_merge_sets(ir_node **new_nodes, int n_new_nodes,
...
@@ -195,6 +195,21 @@ void default_dbg_info_merge_sets(ir_node **new_nodes, int n_new_nodes,
/** @} */
/** @} */
/** The type of the debug info retriever function. */
typedef
const
char
*
(
*
retrieve_dbg_func
)(
const
dbg_info
*
dbg
,
unsigned
*
line
);
/**
* Sets a debug info retriever.
*
* @param func the debug retriever function.
*/
void
ir_set_debug_retrieve
(
retrieve_dbg_func
func
);
/**
* Retrieve the debug info.
*/
const
char
*
ir_retrieve_dbg_info
(
const
dbg_info
*
dbg
,
unsigned
*
line
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
ir/be/arm/arm_emitter.c
View file @
c3e48b15
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
#include
"irargs_t.h"
#include
"irargs_t.h"
#include
"error.h"
#include
"error.h"
#include
"raw_bitset.h"
#include
"raw_bitset.h"
#include
"dbginfo.h"
#include
"../besched.h"
#include
"../besched.h"
#include
"../beblocksched.h"
#include
"../beblocksched.h"
...
@@ -994,7 +995,7 @@ static unsigned num = -1;
...
@@ -994,7 +995,7 @@ static unsigned num = -1;
static
void
arm_emit_dbg
(
const
ir_node
*
irn
)
{
static
void
arm_emit_dbg
(
const
ir_node
*
irn
)
{
dbg_info
*
db
=
get_irn_dbg_info
(
irn
);
dbg_info
*
db
=
get_irn_dbg_info
(
irn
);
unsigned
lineno
;
unsigned
lineno
;
const
char
*
fname
=
be
_retrieve_dbg_info
(
db
,
&
lineno
);
const
char
*
fname
=
ir
_retrieve_dbg_info
(
db
,
&
lineno
);
if
(
!
cg
->
birg
->
main_env
->
options
->
stabs_debug_support
)
if
(
!
cg
->
birg
->
main_env
->
options
->
stabs_debug_support
)
return
;
return
;
...
...
ir/be/beemitter.c
View file @
c3e48b15
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include
"irprintf.h"
#include
"irprintf.h"
#include
"ident.h"
#include
"ident.h"
#include
"tv.h"
#include
"tv.h"
#include
"dbginfo.h"
FILE
*
emit_file
;
FILE
*
emit_file
;
struct
obstack
emit_obst
;
struct
obstack
emit_obst
;
...
@@ -116,7 +117,7 @@ void be_emit_finish_line_gas(const ir_node *node)
...
@@ -116,7 +117,7 @@ void be_emit_finish_line_gas(const ir_node *node)
be_emit_irprintf
(
"%+F "
,
node
);
be_emit_irprintf
(
"%+F "
,
node
);
dbg
=
get_irn_dbg_info
(
node
);
dbg
=
get_irn_dbg_info
(
node
);
sourcefile
=
be
_retrieve_dbg_info
(
dbg
,
&
lineno
);
sourcefile
=
ir
_retrieve_dbg_info
(
dbg
,
&
lineno
);
if
(
sourcefile
!=
NULL
)
{
if
(
sourcefile
!=
NULL
)
{
be_emit_string
(
sourcefile
);
be_emit_string
(
sourcefile
);
be_emit_irprintf
(
":%u"
,
lineno
);
be_emit_irprintf
(
":%u"
,
lineno
);
...
...
ir/be/bemain.c
View file @
c3e48b15
...
@@ -434,12 +434,12 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
...
@@ -434,12 +434,12 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
or try to read in profile data for current translation unit.
or try to read in profile data for current translation unit.
*/
*/
if
(
be_options
.
opt_profile
)
{
if
(
be_options
.
opt_profile
)
{
ir_graph
*
prof_init_irg
=
be
_profile_instrument
(
prof_filename
,
profile_default
);
ir_graph
*
prof_init_irg
=
ir
_profile_instrument
(
prof_filename
,
profile_default
);
initialize_birg
(
&
birgs
[
num_birgs
],
prof_init_irg
,
&
env
);
initialize_birg
(
&
birgs
[
num_birgs
],
prof_init_irg
,
&
env
);
num_birgs
++
;
num_birgs
++
;
set_method_img_section
(
get_irg_entity
(
prof_init_irg
),
section_constructors
);
set_method_img_section
(
get_irg_entity
(
prof_init_irg
),
section_constructors
);
}
else
{
}
else
{
be
_profile_read
(
prof_filename
);
ir
_profile_read
(
prof_filename
);
}
}
/* For all graphs */
/* For all graphs */
...
@@ -535,8 +535,8 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
...
@@ -535,8 +535,8 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
/**
/**
* Create execution frequencies from profile data or estimate some
* Create execution frequencies from profile data or estimate some
*/
*/
if
(
be
_profile_has_data
())
if
(
ir
_profile_has_data
())
birg
->
exec_freq
=
be
_create_execfreqs_from_profile
(
irg
);
birg
->
exec_freq
=
ir
_create_execfreqs_from_profile
(
irg
);
else
else
birg
->
exec_freq
=
compute_execfreq
(
irg
,
10
);
birg
->
exec_freq
=
compute_execfreq
(
irg
,
10
);
...
@@ -736,7 +736,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
...
@@ -736,7 +736,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
#endif /* if 0 */
#endif /* if 0 */
stat_ev_ctx_pop
(
"bemain_irg"
);
stat_ev_ctx_pop
(
"bemain_irg"
);
}
}
be
_profile_free
();
ir
_profile_free
();
be_done_env
(
&
env
);
be_done_env
(
&
env
);
#undef BE_TIMER_POP
#undef BE_TIMER_POP
...
@@ -802,23 +802,6 @@ void be_main(FILE *file_handle, const char *cup_name)
...
@@ -802,23 +802,6 @@ void be_main(FILE *file_handle, const char *cup_name)
#endif
#endif
}
}
/** The debug info retriever function. */
static
retrieve_dbg_func
retrieve_dbg
=
NULL
;
/* Sets a debug info retriever. */
void
be_set_debug_retrieve
(
retrieve_dbg_func
func
)
{
retrieve_dbg
=
func
;
}
/* Retrieve the debug info. */
const
char
*
be_retrieve_dbg_info
(
const
dbg_info
*
dbg
,
unsigned
*
line
)
{
if
(
retrieve_dbg
)
return
retrieve_dbg
(
dbg
,
line
);
*
line
=
0
;
return
NULL
;
}
unsigned
be_put_ignore_regs
(
const
be_irg_t
*
birg
,
const
arch_register_class_t
*
cls
,
bitset_t
*
bs
)
unsigned
be_put_ignore_regs
(
const
be_irg_t
*
birg
,
const
arch_register_class_t
*
cls
,
bitset_t
*
bs
)
{
{
if
(
bs
==
NULL
)
if
(
bs
==
NULL
)
...
...
ir/be/bespillremat.c
View file @
c3e48b15
...
@@ -440,8 +440,8 @@ static double
...
@@ -440,8 +440,8 @@ static double
execution_frequency
(
const
spill_ilp_t
*
si
,
const
ir_node
*
irn
)
execution_frequency
(
const
spill_ilp_t
*
si
,
const
ir_node
*
irn
)
{
{
#define FUDGE 0.001
#define FUDGE 0.001
if
(
be
_profile_has_data
())
if
(
ir
_profile_has_data
())
return
((
double
)
be
_profile_get_block_execcount
(
get_block_const
(
irn
)))
+
FUDGE
;
return
((
double
)
ir
_profile_get_block_execcount
(
get_block_const
(
irn
)))
+
FUDGE
;
#ifndef EXECFREQ_LOOPDEPH
#ifndef EXECFREQ_LOOPDEPH
return
get_block_execfreq
(
si
->
birg
->
exec_freq
,
get_block_const
(
irn
))
+
FUDGE
;
return
get_block_execfreq
(
si
->
birg
->
exec_freq
,
get_block_const
(
irn
))
+
FUDGE
;
...
...
ir/be/ia32/ia32_emitter.c
View file @
c3e48b15
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
#include
"execfreq.h"
#include
"execfreq.h"
#include
"error.h"
#include
"error.h"
#include
"raw_bitset.h"
#include
"raw_bitset.h"
#include
"dbginfo.h"
#include
"../besched_t.h"
#include
"../besched_t.h"
#include
"../benode_t.h"
#include
"../benode_t.h"
...
@@ -1915,7 +1916,7 @@ static void ia32_emit_dbg(const ir_node *node)
...
@@ -1915,7 +1916,7 @@ static void ia32_emit_dbg(const ir_node *node)
{
{
dbg_info
*
db
=
get_irn_dbg_info
(
node
);
dbg_info
*
db
=
get_irn_dbg_info
(
node
);
unsigned
lineno
;
unsigned
lineno
;
const
char
*
fname
=
be
_retrieve_dbg_info
(
db
,
&
lineno
);
const
char
*
fname
=
ir
_retrieve_dbg_info
(
db
,
&
lineno
);
if
(
!
cg
->
birg
->
main_env
->
options
->
stabs_debug_support
)
if
(
!
cg
->
birg
->
main_env
->
options
->
stabs_debug_support
)
return
;
return
;
...
...
ir/debug/dbginfo.c
View file @
c3e48b15
...
@@ -101,3 +101,20 @@ void default_dbg_info_merge_sets(ir_node **new_nodes, int n_new_nodes,
...
@@ -101,3 +101,20 @@ void default_dbg_info_merge_sets(ir_node **new_nodes, int n_new_nodes,
set_irn_dbg_info
(
new_nodes
[
i
],
old_db
);
set_irn_dbg_info
(
new_nodes
[
i
],
old_db
);
}
}
}
/* default_dbg_info_merge_sets */
}
/* default_dbg_info_merge_sets */
/** The debug info retriever function. */
static
retrieve_dbg_func
retrieve_dbg
=
NULL
;
/* Sets a debug info retriever. */
void
ir_set_debug_retrieve
(
retrieve_dbg_func
func
)
{
retrieve_dbg
=
func
;
}
/* Retrieve the debug info. */
const
char
*
ir_retrieve_dbg_info
(
const
dbg_info
*
dbg
,
unsigned
*
line
)
{
if
(
retrieve_dbg
)
return
retrieve_dbg
(
dbg
,
line
);
*
line
=
0
;
return
NULL
;
}
Write
Preview
Supports
Markdown
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