Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
ea6cf778
Commit
ea6cf778
authored
Jun 01, 2011
by
David Li
Committed by
Xinliang David Li
Jun 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better function header dump
From-SVN: r174536
parent
eeeb9b49
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
35 deletions
+49
-35
gcc/ChangeLog
+7
-0
gcc/final.c
+2
-14
gcc/passes.c
+2
-15
gcc/tree-cfg.c
+1
-6
gcc/tree-pretty-print.c
+36
-0
gcc/tree-pretty-print.h
+1
-0
No files found.
gcc/ChangeLog
View file @
ea6cf778
2011-06-01 David Li <davidxl@google.com>
* tree-pretty-print.c (dump_function_header): New function.
* final.c (rest_of_clean_state): Use header dumper.
* tree-cfg.c (gimple_dump_cfg): Use header dumper.
* passes.c (pass_init_dump_file): Use header dumper.
2011-06-01 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (compare_loc_descriptor, scompare_loc_descriptor,
...
...
gcc/final.c
View file @
ea6cf778
...
...
@@ -83,6 +83,7 @@ along with GCC; see the file COPYING3. If not see
#include "ggc.h"
#include "cfgloop.h"
#include "params.h"
#include "tree-pretty-print.h"
#ifdef XCOFF_DEBUGGING_INFO
#include "xcoffout.h"
/* Needed for external data
...
...
@@ -4360,20 +4361,7 @@ rest_of_clean_state (void)
}
else
{
const
char
*
aname
;
struct
cgraph_node
*
node
=
cgraph_get_node
(
current_function_decl
);
aname
=
(
IDENTIFIER_POINTER
(
DECL_ASSEMBLER_NAME
(
current_function_decl
)));
fprintf
(
final_output
,
"
\n
;; Function (%s) %s
\n\n
"
,
aname
,
node
->
frequency
==
NODE_FREQUENCY_HOT
?
" (hot)"
:
node
->
frequency
==
NODE_FREQUENCY_UNLIKELY_EXECUTED
?
" (unlikely executed)"
:
node
->
frequency
==
NODE_FREQUENCY_EXECUTED_ONCE
?
" (executed once)"
:
""
);
dump_function_header
(
final_output
,
current_function_decl
);
flag_dump_noaddr
=
flag_dump_unnumbered
=
1
;
if
(
flag_compare_debug_opt
||
flag_compare_debug
)
dump_flags
|=
TDF_NOUID
;
...
...
gcc/passes.c
View file @
ea6cf778
...
...
@@ -74,6 +74,7 @@ along with GCC; see the file COPYING3. If not see
#include "lto-streamer.h"
#include "plugin.h"
#include "ipa-utils.h"
#include "tree-pretty-print.h"
#if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
#include "dwarf2out.h"
...
...
@@ -1637,21 +1638,7 @@ pass_init_dump_file (struct opt_pass *pass)
dump_file_name
=
get_dump_file_name
(
pass
->
static_pass_number
);
dump_file
=
dump_begin
(
pass
->
static_pass_number
,
&
dump_flags
);
if
(
dump_file
&&
current_function_decl
)
{
const
char
*
dname
,
*
aname
;
struct
cgraph_node
*
node
=
cgraph_get_node
(
current_function_decl
);
dname
=
lang_hooks
.
decl_printable_name
(
current_function_decl
,
2
);
aname
=
(
IDENTIFIER_POINTER
(
DECL_ASSEMBLER_NAME
(
current_function_decl
)));
fprintf
(
dump_file
,
"
\n
;; Function %s (%s)%s
\n\n
"
,
dname
,
aname
,
node
->
frequency
==
NODE_FREQUENCY_HOT
?
" (hot)"
:
node
->
frequency
==
NODE_FREQUENCY_UNLIKELY_EXECUTED
?
" (unlikely executed)"
:
node
->
frequency
==
NODE_FREQUENCY_EXECUTED_ONCE
?
" (executed once)"
:
""
);
}
dump_function_header
(
dump_file
,
current_function_decl
);
return
initializing_dump
;
}
else
...
...
gcc/tree-cfg.c
View file @
ea6cf778
...
...
@@ -2052,11 +2052,7 @@ gimple_dump_cfg (FILE *file, int flags)
{
if
(
flags
&
TDF_DETAILS
)
{
const
char
*
funcname
=
lang_hooks
.
decl_printable_name
(
current_function_decl
,
2
);
fputc
(
'\n'
,
file
);
fprintf
(
file
,
";; Function %s
\n\n
"
,
funcname
);
dump_function_header
(
file
,
current_function_decl
);
fprintf
(
file
,
";;
\n
%d basic blocks, %d edges, last basic block %d.
\n\n
"
,
n_basic_blocks
,
n_edges
,
last_basic_block
);
...
...
@@ -7525,4 +7521,3 @@ struct gimple_opt_pass pass_warn_unused_result =
0
,
/* todo_flags_finish */
}
};
gcc/tree-pretty-print.c
View file @
ea6cf778
...
...
@@ -3013,3 +3013,39 @@ pp_base_tree_identifier (pretty_printer *pp, tree id)
pp_append_text
(
pp
,
IDENTIFIER_POINTER
(
id
),
IDENTIFIER_POINTER
(
id
)
+
IDENTIFIER_LENGTH
(
id
));
}
/* A helper function that is used to dump function information before the
function dump. */
void
dump_function_header
(
FILE
*
dump_file
,
tree
fdecl
)
{
const
char
*
dname
,
*
aname
;
struct
cgraph_node
*
node
=
cgraph_get_node
(
fdecl
);
struct
function
*
fun
=
DECL_STRUCT_FUNCTION
(
fdecl
);
dname
=
lang_hooks
.
decl_printable_name
(
fdecl
,
2
);
if
(
DECL_ASSEMBLER_NAME_SET_P
(
fdecl
))
aname
=
(
IDENTIFIER_POINTER
(
DECL_ASSEMBLER_NAME
(
fdecl
)));
else
aname
=
"<unset-asm-name>"
;
if
(
node
)
{
fprintf
(
dump_file
,
"
\n
;; Function %s (%s, funcdef_no=%d, decl_uid = %d, cgraph_uid=%d)"
,
dname
,
aname
,
fun
->
funcdef_no
,
DECL_UID
(
fdecl
),
node
->
uid
);
fprintf
(
dump_file
,
"%s
\n\n
"
,
node
->
frequency
==
NODE_FREQUENCY_HOT
?
" (hot)"
:
node
->
frequency
==
NODE_FREQUENCY_UNLIKELY_EXECUTED
?
" (unlikely executed)"
:
node
->
frequency
==
NODE_FREQUENCY_EXECUTED_ONCE
?
" (executed once)"
:
""
);
}
else
fprintf
(
dump_file
,
"
\n
;; Function %s (%s, funcdef_no=%d, decl_uid = %d)"
,
dname
,
aname
,
fun
->
funcdef_no
,
DECL_UID
(
fdecl
));
}
gcc/tree-pretty-print.h
View file @
ea6cf778
...
...
@@ -50,6 +50,7 @@ extern void debug_generic_expr (tree);
extern
void
debug_generic_stmt
(
tree
);
extern
void
debug_tree_chain
(
tree
);
extern
void
percent_K_format
(
text_info
*
);
extern
void
dump_function_header
(
FILE
*
,
tree
);
/* In toplev.c */
extern
bool
default_tree_printer
(
pretty_printer
*
,
text_info
*
,
const
char
*
,
...
...
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