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
d7248bff
Commit
d7248bff
authored
Oct 04, 1996
by
Jason Merrill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
From-SVN: r12903
parent
af6d53df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
46 deletions
+35
-46
gcc/dwarf2out.c
+35
-46
No files found.
gcc/dwarf2out.c
View file @
d7248bff
...
@@ -6282,37 +6282,22 @@ gen_subprogram_die (decl, context_die)
...
@@ -6282,37 +6282,22 @@ gen_subprogram_die (decl, context_die)
(if it has one - it may be just a declaration). */
(if it has one - it may be just a declaration). */
outer_scope
=
DECL_INITIAL
(
decl
);
outer_scope
=
DECL_INITIAL
(
decl
);
/* Note that here, `outer_scope' is a pointer to the outermost BLOCK
node created to represent a function. This outermost BLOCK actually
represents the outermost binding contour for the function, i.e. the
contour in which the function's formal parameters and labels get
declared. Curiously, it appears that the front end doesn't actually
put the PARM_DECL nodes for the current function onto the BLOCK_VARS
list for this outer scope. (They are strung off of the DECL_ARGUMENTS
list for the function instead.) The BLOCK_VARS list for the
`outer_scope' does provide us with a list of the LABEL_DECL nodes for
the function however, and we output DWARF info for those in
decls_for_scope. Just within the `outer_scope' there will be a BLOCK
node representing the function's outermost pair of curly braces, and
any blocks used for the base and member initializers of a C++
constructor function. */
if
(
outer_scope
&&
TREE_CODE
(
outer_scope
)
!=
ERROR_MARK
)
if
(
outer_scope
&&
TREE_CODE
(
outer_scope
)
!=
ERROR_MARK
)
{
decls_for_scope
(
outer_scope
,
subr_die
,
0
);
/* Note that here, `outer_scope' is a pointer to the outermost BLOCK
node created to represent a function. This outermost BLOCK actually
represents the outermost binding contour for the function, i.e. the
contour in which the function's formal parameters and labels get
declared. Curiously, it appears that the front end doesn't actually
put the PARM_DECL nodes for the current function onto the BLOCK_VARS
list for this outer scope. (They are strung off of the
DECL_ARGUMENTS list for the function instead.) The BLOCK_VARS list
for the `outer_scope' does provide us with a list of the LABEL_DECL
nodes for the function however, and we output DWARF info for those
here. Just within the `outer_scope' there will be another BLOCK node
representing the function's outermost pair of curly braces. We
musn't generate a lexical_block DIE for this outermost pair of curly
braces because that is not really an independent scope according to
ANSI C rules. Rather, it is the same scope in which the parameters
were declared. */
for
(
label
=
BLOCK_VARS
(
outer_scope
);
label
;
label
=
TREE_CHAIN
(
label
))
{
gen_decl_die
(
label
,
subr_die
);
}
/* Note here that `BLOCK_SUBBLOCKS (outer_scope)' points to a list of
BLOCK nodes which is always only one element long. That one element
represents the outermost pair of curley braces for the function
body. */
decls_for_scope
(
BLOCK_SUBBLOCKS
(
outer_scope
),
subr_die
);
}
}
}
/* Generate a DIE to represent a declared data object. */
/* Generate a DIE to represent a declared data object. */
...
@@ -6418,9 +6403,10 @@ gen_label_die (decl, context_die)
...
@@ -6418,9 +6403,10 @@ gen_label_die (decl, context_die)
/* Generate a DIE for a lexical block. */
/* Generate a DIE for a lexical block. */
static
void
static
void
gen_lexical_block_die
(
stmt
,
context_die
)
gen_lexical_block_die
(
stmt
,
context_die
,
depth
)
register
tree
stmt
;
register
tree
stmt
;
register
dw_die_ref
context_die
;
register
dw_die_ref
context_die
;
int
depth
;
{
{
register
dw_die_ref
stmt_die
=
new_die
(
DW_TAG_lexical_block
,
context_die
);
register
dw_die_ref
stmt_die
=
new_die
(
DW_TAG_lexical_block
,
context_die
);
char
label
[
MAX_ARTIFICIAL_LABEL_BYTES
];
char
label
[
MAX_ARTIFICIAL_LABEL_BYTES
];
...
@@ -6431,27 +6417,28 @@ gen_lexical_block_die (stmt, context_die)
...
@@ -6431,27 +6417,28 @@ gen_lexical_block_die (stmt, context_die)
sprintf
(
label
,
BLOCK_END_LABEL_FMT
,
next_block_number
);
sprintf
(
label
,
BLOCK_END_LABEL_FMT
,
next_block_number
);
add_AT_lbl_id
(
stmt_die
,
DW_AT_high_pc
,
label
);
add_AT_lbl_id
(
stmt_die
,
DW_AT_high_pc
,
label
);
}
}
decls_for_scope
(
stmt
,
stmt_die
);
decls_for_scope
(
stmt
,
stmt_die
,
depth
);
}
}
/* Generate a DIE for an inlined subprogram. */
/* Generate a DIE for an inlined subprogram. */
static
void
static
void
gen_inlined_subroutine_die
(
stmt
,
context_die
)
gen_inlined_subroutine_die
(
stmt
,
context_die
,
depth
)
register
tree
stmt
;
register
tree
stmt
;
register
dw_die_ref
context_die
;
register
dw_die_ref
context_die
;
int
depth
;
{
{
register
dw_die_ref
subr_die
=
new_die
(
DW_TAG_inlined_subroutine
,
context_die
);
char
label
[
MAX_ARTIFICIAL_LABEL_BYTES
];
add_abstract_origin_attribute
(
subr_die
,
block_ultimate_origin
(
stmt
));
if
(
!
BLOCK_ABSTRACT
(
stmt
))
if
(
!
BLOCK_ABSTRACT
(
stmt
))
{
{
register
dw_die_ref
subr_die
=
new_die
(
DW_TAG_inlined_subroutine
,
context_die
);
char
label
[
MAX_ARTIFICIAL_LABEL_BYTES
];
add_abstract_origin_attribute
(
subr_die
,
block_ultimate_origin
(
stmt
));
sprintf
(
label
,
BLOCK_BEGIN_LABEL_FMT
,
next_block_number
);
sprintf
(
label
,
BLOCK_BEGIN_LABEL_FMT
,
next_block_number
);
add_AT_lbl_id
(
subr_die
,
DW_AT_low_pc
,
label
);
add_AT_lbl_id
(
subr_die
,
DW_AT_low_pc
,
label
);
sprintf
(
label
,
BLOCK_END_LABEL_FMT
,
next_block_number
);
sprintf
(
label
,
BLOCK_END_LABEL_FMT
,
next_block_number
);
add_AT_lbl_id
(
subr_die
,
DW_AT_high_pc
,
label
);
add_AT_lbl_id
(
subr_die
,
DW_AT_high_pc
,
label
);
decls_for_scope
(
stmt
,
subr_die
,
depth
);
}
}
decls_for_scope
(
stmt
,
subr_die
);
}
}
/* Generate a DIE for a field in a record, or structure. */
/* Generate a DIE for a field in a record, or structure. */
...
@@ -6921,9 +6908,10 @@ gen_tagged_type_instantiation_die (type, context_die)
...
@@ -6921,9 +6908,10 @@ gen_tagged_type_instantiation_die (type, context_die)
/* Generate a DW_TAG_lexical_block DIE followed by DIEs to represent all of the
/* Generate a DW_TAG_lexical_block DIE followed by DIEs to represent all of the
things which are local to the given block. */
things which are local to the given block. */
static
void
static
void
gen_block_die
(
stmt
,
context_die
)
gen_block_die
(
stmt
,
context_die
,
depth
)
register
tree
stmt
;
register
tree
stmt
;
register
dw_die_ref
context_die
;
register
dw_die_ref
context_die
;
int
depth
;
{
{
register
int
must_output_die
=
0
;
register
int
must_output_die
=
0
;
register
tree
origin
;
register
tree
origin
;
...
@@ -6963,7 +6951,7 @@ gen_block_die (stmt, context_die)
...
@@ -6963,7 +6951,7 @@ gen_block_die (stmt, context_die)
rules. So we check here to make sure that this block does not
rules. So we check here to make sure that this block does not
represent a "body block inlining" before trying to set the
represent a "body block inlining" before trying to set the
`must_output_die' flag. */
`must_output_die' flag. */
if
(
origin
==
NULL
||
!
is_body_block
(
origin
))
if
(
!
is_body_block
(
origin
?
origin
:
stmt
))
{
{
/* Determine if this block directly contains any "significant"
/* Determine if this block directly contains any "significant"
local declarations which we will need to output DIEs for. */
local declarations which we will need to output DIEs for. */
...
@@ -7002,23 +6990,24 @@ gen_block_die (stmt, context_die)
...
@@ -7002,23 +6990,24 @@ gen_block_die (stmt, context_die)
{
{
if
(
origin_code
==
FUNCTION_DECL
)
if
(
origin_code
==
FUNCTION_DECL
)
{
{
gen_inlined_subroutine_die
(
stmt
,
context_die
);
gen_inlined_subroutine_die
(
stmt
,
context_die
,
depth
);
}
}
else
else
{
{
gen_lexical_block_die
(
stmt
,
context_die
);
gen_lexical_block_die
(
stmt
,
context_die
,
depth
);
}
}
}
}
else
else
decls_for_scope
(
stmt
,
context_die
);
decls_for_scope
(
stmt
,
context_die
,
depth
);
}
}
/* Generate all of the decls declared within a given scope and (recursively)
/* Generate all of the decls declared within a given scope and (recursively)
all of it's sub-blocks. */
all of it's sub-blocks. */
static
void
static
void
decls_for_scope
(
stmt
,
context_die
)
decls_for_scope
(
stmt
,
context_die
,
depth
)
register
tree
stmt
;
register
tree
stmt
;
register
dw_die_ref
context_die
;
register
dw_die_ref
context_die
;
int
depth
;
{
{
register
tree
decl
;
register
tree
decl
;
register
tree
subblocks
;
register
tree
subblocks
;
...
@@ -7027,7 +7016,7 @@ decls_for_scope (stmt, context_die)
...
@@ -7027,7 +7016,7 @@ decls_for_scope (stmt, context_die)
{
{
return
;
return
;
}
}
if
(
!
BLOCK_ABSTRACT
(
stmt
))
if
(
!
BLOCK_ABSTRACT
(
stmt
)
&&
depth
>
0
)
{
{
next_block_number
++
;
next_block_number
++
;
}
}
...
@@ -7047,7 +7036,7 @@ decls_for_scope (stmt, context_die)
...
@@ -7047,7 +7036,7 @@ decls_for_scope (stmt, context_die)
subblocks
!=
NULL
;
subblocks
!=
NULL
;
subblocks
=
BLOCK_CHAIN
(
subblocks
))
subblocks
=
BLOCK_CHAIN
(
subblocks
))
{
{
gen_block_die
(
subblocks
,
context_die
);
gen_block_die
(
subblocks
,
context_die
,
depth
+
1
);
}
}
}
}
...
...
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