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
a082c85a
Commit
a082c85a
authored
Nov 09, 1996
by
Jason Merrill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
From-SVN: r13116
parent
9b04c6a8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
37 deletions
+64
-37
gcc/dwarf2out.c
+28
-10
gcc/stor-layout.c
+1
-1
gcc/toplev.c
+2
-6
gcc/tree.def
+6
-4
gcc/tree.h
+3
-2
gcc/varasm.c
+24
-14
No files found.
gcc/dwarf2out.c
View file @
a082c85a
...
@@ -6358,6 +6358,7 @@ gen_enumeration_type_die (type, context_die)
...
@@ -6358,6 +6358,7 @@ gen_enumeration_type_die (type, context_die)
if
(
TYPE_SIZE
(
type
))
if
(
TYPE_SIZE
(
type
))
{
{
register
tree
link
;
register
tree
link
;
TREE_ASM_WRITTEN
(
type
)
=
1
;
add_byte_size_attribute
(
type_die
,
type
);
add_byte_size_attribute
(
type_die
,
type
);
for
(
link
=
TYPE_FIELDS
(
type
);
for
(
link
=
TYPE_FIELDS
(
type
);
link
!=
NULL
;
link
=
TREE_CHAIN
(
link
))
link
!=
NULL
;
link
=
TREE_CHAIN
(
link
))
...
@@ -7119,18 +7120,26 @@ gen_struct_or_union_type_die (type, context_die)
...
@@ -7119,18 +7120,26 @@ gen_struct_or_union_type_die (type, context_die)
register
dw_die_ref
context_die
;
register
dw_die_ref
context_die
;
{
{
register
dw_die_ref
type_die
=
lookup_type_die
(
type
);
register
dw_die_ref
type_die
=
lookup_type_die
(
type
);
register
dw_die_ref
scope_die
=
0
;
register
int
nested
=
0
;
if
(
type_die
&&
!
TYPE_SIZE
(
type
))
if
(
type_die
&&
!
TYPE_SIZE
(
type
))
return
;
return
;
else
if
(
!
type_die
||
(
TYPE_CONTEXT
(
type
)
if
(
TYPE_CONTEXT
(
type
)
&&
TREE_CODE_CLASS
(
TREE_CODE
(
TYPE_CONTEXT
(
type
)))
==
't'
))
&&
TREE_CODE_CLASS
(
TREE_CODE
(
TYPE_CONTEXT
(
type
)))
==
't'
)
nested
=
1
;
if
(
!
type_die
||
nested
)
scope_die
=
scope_die_for
(
type
,
context_die
);
if
(
!
type_die
||
(
nested
&&
scope_die
==
comp_unit_die
))
/* First occurrence of type or toplevel definition of nested class. */
/* First occurrence of type or toplevel definition of nested class. */
{
{
register
dw_die_ref
old_die
=
type_die
;
register
dw_die_ref
old_die
=
type_die
;
type_die
=
new_die
(
TREE_CODE
(
type
)
==
RECORD_TYPE
type_die
=
new_die
(
TREE_CODE
(
type
)
==
RECORD_TYPE
?
DW_TAG_structure_type
:
DW_TAG_union_type
,
?
DW_TAG_structure_type
:
DW_TAG_union_type
,
scope_die
_for
(
type
,
context_die
)
);
scope_die
);
equate_type_number_to_die
(
type
,
type_die
);
equate_type_number_to_die
(
type
,
type_die
);
add_name_attribute
(
type_die
,
type_tag
(
type
));
add_name_attribute
(
type_die
,
type_tag
(
type
));
if
(
old_die
)
if
(
old_die
)
...
@@ -7141,7 +7150,11 @@ gen_struct_or_union_type_die (type, context_die)
...
@@ -7141,7 +7150,11 @@ gen_struct_or_union_type_die (type, context_die)
/* If this type has been completed, then give it a byte_size attribute and
/* If this type has been completed, then give it a byte_size attribute and
then give a list of members. */
then give a list of members. */
if
(
TYPE_SIZE
(
type
))
if
(
TYPE_SIZE
(
type
)
/* If we're getting a reference to one nested class from another
nested class, don't recurse. */
&&
!
(
nested
&&
scope_die
!=
context_die
&&
scope_die
==
lookup_type_die
(
TYPE_CONTEXT
(
type
))))
{
{
/* Prevent infinite recursion in cases where the type of some member of
/* Prevent infinite recursion in cases where the type of some member of
this type is expressed in terms of this type itself. */
this type is expressed in terms of this type itself. */
...
@@ -7279,16 +7292,21 @@ gen_type_die (type, context_die)
...
@@ -7279,16 +7292,21 @@ gen_type_die (type, context_die)
case
RECORD_TYPE
:
case
RECORD_TYPE
:
case
UNION_TYPE
:
case
UNION_TYPE
:
case
QUAL_UNION_TYPE
:
case
QUAL_UNION_TYPE
:
if
(
TREE_CODE
(
type
)
==
ENUMERAL_TYPE
)
/* If this is a nested type whose containing class hasn't been
written out yet, writing it out will cover this one, too. */
if
(
TYPE_CONTEXT
(
type
)
&&
TREE_CODE_CLASS
(
TREE_CODE
(
TYPE_CONTEXT
(
type
)))
==
't'
&&
!
TREE_ASM_WRITTEN
(
TYPE_CONTEXT
(
type
)))
gen_type_die
(
TYPE_CONTEXT
(
type
),
context_die
);
else
if
(
TREE_CODE
(
type
)
==
ENUMERAL_TYPE
)
gen_enumeration_type_die
(
type
,
context_die
);
gen_enumeration_type_die
(
type
,
context_die
);
else
else
gen_struct_or_union_type_die
(
type
,
context_die
);
gen_struct_or_union_type_die
(
type
,
context_die
);
/* Don't set TREE_ASM_WRITTEN on an incomplete struct; we want to fix
/* Don't set TREE_ASM_WRITTEN on an incomplete struct; we want to fix
it up if it is ever completed. */
it up if it is ever completed. gen_*_type_die will set it for us
if
(
TYPE_SIZE
(
type
)
==
NULL_TREE
)
when appropriate. */
return
;
return
;
break
;
case
VOID_TYPE
:
case
VOID_TYPE
:
case
INTEGER_TYPE
:
case
INTEGER_TYPE
:
...
...
gcc/stor-layout.c
View file @
a082c85a
...
@@ -336,7 +336,7 @@ layout_record (rec)
...
@@ -336,7 +336,7 @@ layout_record (rec)
In both cases, all we do is lay out the decl,
In both cases, all we do is lay out the decl,
and we do it *after* the record is laid out. */
and we do it *after* the record is laid out. */
if
(
TREE_
STATIC
(
field
)
)
if
(
TREE_
CODE
(
field
)
==
VAR_DECL
)
{
{
pending_statics
=
tree_cons
(
NULL_TREE
,
field
,
pending_statics
);
pending_statics
=
tree_cons
(
NULL_TREE
,
field
,
pending_statics
);
continue
;
continue
;
...
...
gcc/toplev.c
View file @
a082c85a
...
@@ -2752,12 +2752,8 @@ rest_of_type_compilation (type, toplev)
...
@@ -2752,12 +2752,8 @@ rest_of_type_compilation (type, toplev)
TIMEVAR
(
symout_time
,
sdbout_symbol
(
TYPE_STUB_DECL
(
type
),
!
toplev
));
TIMEVAR
(
symout_time
,
sdbout_symbol
(
TYPE_STUB_DECL
(
type
),
!
toplev
));
#endif
#endif
#ifdef DWARF_DEBUGGING_INFO
#ifdef DWARF_DEBUGGING_INFO
/* If this is a file-scope type or a class-scope type
/* Don't write out function-scope types here. */
for which the containing class has already been completed, write it
if
(
write_symbols
==
DWARF_DEBUG
&&
toplev
)
out now to avoid ordering headaches with member functions. */
if
(
write_symbols
==
DWARF_DEBUG
&&
(
TYPE_CONTEXT
(
type
)
==
NULL_TREE
||
TREE_ASM_WRITTEN
(
TYPE_CONTEXT
(
type
))))
TIMEVAR
(
symout_time
,
dwarfout_file_scope_decl
(
TYPE_STUB_DECL
(
type
),
0
));
TIMEVAR
(
symout_time
,
dwarfout_file_scope_decl
(
TYPE_STUB_DECL
(
type
),
0
));
#endif
#endif
}
}
...
...
gcc/tree.def
View file @
a082c85a
...
@@ -208,7 +208,9 @@ DEFTREECODE (SET_TYPE, "set_type", "t", 0)
...
@@ -208,7 +208,9 @@ DEFTREECODE (SET_TYPE, "set_type", "t", 0)
/* Struct in C, or record in Pascal. */
/* Struct in C, or record in Pascal. */
/* Special fields:
/* Special fields:
TYPE_FIELDS chain of FIELD_DECLs for the fields of the struct.
TYPE_FIELDS chain of FIELD_DECLs for the fields of the struct,
and VAR_DECLs, TYPE_DECLs and CONST_DECLs for record-scope variables,
types and enumerators.
A few may need to be added for Pascal. */
A few may need to be added for Pascal. */
/* See the comment above, before ENUMERAL_TYPE, for how
/* See the comment above, before ENUMERAL_TYPE, for how
forward references to struct tags are handled in C. */
forward references to struct tags are handled in C. */
...
@@ -271,9 +273,9 @@ DEFTREECODE (STRING_CST, "string_cst", "c", 3)
...
@@ -271,9 +273,9 @@ DEFTREECODE (STRING_CST, "string_cst", "c", 3)
this declaration has its scope. For FIELD_DECLs, this is the
this declaration has its scope. For FIELD_DECLs, this is the
RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE node that the field
RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE node that the field
is a member of. For VAR_DECL, PARM_DECL, FUNCTION_DECL, LABEL_DECL,
is a member of. For VAR_DECL, PARM_DECL, FUNCTION_DECL, LABEL_DECL,
and CONST_DECL nodes, this points to the FUNCTION_DECL for the
and CONST_DECL nodes, this points to
either
the FUNCTION_DECL for the
containing function,
or else yields NULL_TREE if the given decl
containing function,
the RECORD_TYPE or UNION_TYPE for the containing
has "file scope".
type, or NULL_TREE if the given decl
has "file scope".
DECL_ABSTRACT_ORIGIN, if non-NULL, points to the original (abstract)
DECL_ABSTRACT_ORIGIN, if non-NULL, points to the original (abstract)
..._DECL node of which this decl is an (inlined or template expanded)
..._DECL node of which this decl is an (inlined or template expanded)
instance.
instance.
...
...
gcc/tree.h
View file @
a082c85a
...
@@ -880,8 +880,9 @@ struct tree_type
...
@@ -880,8 +880,9 @@ struct tree_type
/* For FIELD_DECLs, this is the
/* For FIELD_DECLs, this is the
RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE node that the field is
RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE node that the field is
a member of. For VAR_DECL, PARM_DECL, FUNCTION_DECL, LABEL_DECL,
a member of. For VAR_DECL, PARM_DECL, FUNCTION_DECL, LABEL_DECL,
and CONST_DECL nodes, this points to the FUNCTION_DECL for the
and CONST_DECL nodes, this points to either the FUNCTION_DECL for the
containing function, or else yields NULL_TREE if the given decl has "file scope". */
containing function, the RECORD_TYPE or UNION_TYPE for the containing
type, or NULL_TREE if the given decl has "file scope". */
#define DECL_CONTEXT(NODE) ((NODE)->decl.context)
#define DECL_CONTEXT(NODE) ((NODE)->decl.context)
#define DECL_FIELD_CONTEXT(NODE) ((NODE)->decl.context)
#define DECL_FIELD_CONTEXT(NODE) ((NODE)->decl.context)
/* In a DECL this is the field where configuration dependent machine
/* In a DECL this is the field where configuration dependent machine
...
...
gcc/varasm.c
View file @
a082c85a
...
@@ -1175,15 +1175,20 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
...
@@ -1175,15 +1175,20 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
&&
(
TREE_PUBLIC
(
decl
)
==
0
||
DECL_INITIAL
(
decl
)
==
0
))
&&
(
TREE_PUBLIC
(
decl
)
==
0
||
DECL_INITIAL
(
decl
)
==
0
))
sdbout_symbol
(
decl
,
0
);
sdbout_symbol
(
decl
,
0
);
#endif
#endif
#ifdef DWARF_DEBUGGING_INFO
if
(
write_symbols
==
DWARF_DEBUG
&&
top_level
&&
DECL_CONTEXT
(
decl
))
dwarfout_file_scope_decl
(
decl
,
0
);
#endif
}
}
/*
Don't output any DWARF debugging information for variables here.
/*
Only output DWARF debugging information for record-scope variables
In the case of local variables, the information for them is output
here. In the case of function-scope variables, the information
when we do our recursive traversal of the tree representation for
for them is output when we do our recursive traversal of the tree
the entire containing function. In the case of file-scope variables,
representation for the entire containing function. In the case of
we output information for all of them at the very end of compilation
file-scope variables, we output information for all of them at the
while we are doing our final traversal of the chain of file-scope
very end of compilation while we are doing our final traversal of
declarations. */
the chain of file-scope
declarations. */
return
;
return
;
}
}
...
@@ -1298,14 +1303,19 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
...
@@ -1298,14 +1303,19 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
&&
(
TREE_PUBLIC
(
decl
)
==
0
||
DECL_INITIAL
(
decl
)
==
0
))
&&
(
TREE_PUBLIC
(
decl
)
==
0
||
DECL_INITIAL
(
decl
)
==
0
))
sdbout_symbol
(
decl
,
0
);
sdbout_symbol
(
decl
,
0
);
#endif
#endif
#ifdef DWARF_DEBUGGING_INFO
if
(
write_symbols
==
DWARF_DEBUG
&&
top_level
&&
DECL_CONTEXT
(
decl
))
dwarfout_file_scope_decl
(
decl
,
0
);
#endif
/*
Don't output any DWARF debugging information for variables here.
/*
Only output DWARF debugging information for record-scope variables
In the case of local variables, the information for them is output
here. In the case of function-scope variables, the information
when we do our recursive traversal of the tree representation for
for them is output when we do our recursive traversal of the tree
the entire containing function. In the case of file-scope variables,
representation for the entire containing function. In the case of
we output information for all of them at the very end of compilation
file-scope variables, we output information for all of them at the
while we are doing our final traversal of the chain of file-scope
very end of compilation while we are doing our final traversal of
declarations. */
the chain of file-scope
declarations. */
#if 0 /* ??? We should either delete this or add a comment describing what
#if 0 /* ??? We should either delete this or add a comment describing what
it was intended to do and why we shouldn't delete it. */
it was intended to do and why we shouldn't delete it. */
...
...
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