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
2e9effae
Commit
2e9effae
authored
Aug 09, 1993
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(contains_pointers_p): New function.
(assemble_variable): Use that. From-SVN: r5117
parent
654209e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
1 deletions
+40
-1
gcc/varasm.c
+40
-1
No files found.
gcc/varasm.c
View file @
2e9effae
...
...
@@ -89,6 +89,7 @@ extern FILE *asm_out_file;
static
char
*
compare_constant_1
();
static
void
record_constant_1
();
static
void
output_constant_def_contents
();
static
int
contains_pointers_p
();
void
output_constant_pool
();
void
assemble_name
();
...
...
@@ -923,7 +924,9 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
#endif
/* Output any data that we will need to use the address of. */
if
(
DECL_INITIAL
(
decl
))
if
(
DECL_INITIAL
(
decl
)
==
error_mark_node
)
reloc
=
contains_pointers_p
(
TREE_TYPE
(
decl
));
else
if
(
DECL_INITIAL
(
decl
))
reloc
=
output_addressed_constants
(
DECL_INITIAL
(
decl
));
/* Switch to the proper section for this data. */
...
...
@@ -1052,6 +1055,42 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
#endif
}
/* Return 1 if type TYPE contains any pointers. */
static
int
contains_pointers_p
(
type
)
tree
type
;
{
switch
(
TREE_CODE
(
type
))
{
case
POINTER_TYPE
:
case
REFERENCE_TYPE
:
/* I'm not sure whether OFFSET_TYPE needs this treatment,
so I'll play safe and return 1. */
case
OFFSET_TYPE
:
return
1
;
case
RECORD_TYPE
:
case
UNION_TYPE
:
case
QUAL_UNION_TYPE
:
{
tree
fields
;
/* For a type that has fields, see if the fields have pointers. */
for
(
fields
=
TYPE_FIELDS
(
type
);
fields
;
fields
=
TREE_CHAIN
(
fields
))
if
(
contains_pointers_p
(
TREE_TYPE
(
fields
)))
return
1
;
return
0
;
}
case
ARRAY_TYPE
:
/* An array type contains pointers if its element type does. */
return
contains_pointers_p
(
TREE_TYPE
(
type
));
default
:
return
0
;
}
}
/* Output something to declare an external symbol to the assembler.
(Most assemblers don't need this, so we normally output nothing.)
Do nothing if DECL is not external. */
...
...
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