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
2a7b6292
Commit
2a7b6292
authored
Oct 28, 1999
by
Peter Gerwinski
Committed by
Jeff Law
Oct 28, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* tree.def (PLACEHOLDER_EXPR): Update comments.
From-SVN: r30241
parent
30145215
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
30 deletions
+43
-30
gcc/ChangeLog
+4
-0
gcc/tree.def
+39
-30
No files found.
gcc/ChangeLog
View file @
2a7b6292
Thu
Oct
28
03
:
37
:
50
1999
Peter
Gerwinski
<
peter
@gerwinski
.
de
>
*
tree
.
def
(
PLACEHOLDER_EXPR
)
:
Update
comments
.
Thu
Oct
28
06
:
47
:
32
1999
Kaveh
R
.
Ghazi
<
ghazi
@caip
.
rutgers
.
edu
>
Thu
Oct
28
06
:
47
:
32
1999
Kaveh
R
.
Ghazi
<
ghazi
@caip
.
rutgers
.
edu
>
*
c
-
common
.
c
(
check_format_info
)
:
Avoid
non
-
literal
format
string
*
c
-
common
.
c
(
check_format_info
)
:
Avoid
non
-
literal
format
string
...
...
gcc/tree.def
View file @
2a7b6292
...
@@ -490,39 +490,48 @@ DEFTREECODE (WITH_CLEANUP_EXPR, "with_cleanup_expr", 'e', 3)
...
@@ -490,39 +490,48 @@ DEFTREECODE (WITH_CLEANUP_EXPR, "with_cleanup_expr", 'e', 3)
DEFTREECODE (CLEANUP_POINT_EXPR, "cleanup_point_expr", 'e', 1)
DEFTREECODE (CLEANUP_POINT_EXPR, "cleanup_point_expr", 'e', 1)
/* The following two codes are used in languages that have types where
/* The following two codes are used in languages that have types where
the position and/or sizes of fields vary from object to object of the
some field in an object of the type contains a value that is used in
same type, i.e., where some other field in the object contains a value
the computation of another field's offset or size and/or the size of
that is used in the computation of another field's offset or size.
the type. The positions and/or sizes of fields can vary from object
to object of the same type.
For example, a record type with a discriminant in Ada is such a type.
This mechanism is also used to create "fat pointers" for unconstrained
Record types with discriminants in Ada or schema types in Pascal are
array types in Ada; the fat pointer is a structure one of whose fields is
examples of such types. This mechanism is also used to create "fat
a pointer to the actual array type and the other field is a pointer to a
pointers" for unconstrained array types in Ada; the fat pointer is a
template, which is a structure containing the bounds of the array. The
structure one of whose fields is a pointer to the actual array type
bounds in the type pointed to by the first field in the fat pointer refer
and the other field is a pointer to a template, which is a structure
to the values in the template.
containing the bounds of the array. The bounds in the type pointed
to by the first field in the fat pointer refer to the values in the
These "self-references" are doing using a PLACEHOLDER_EXPR. This is a
template.
node that will later be replaced with the object being referenced. Its type
is that of the object and selects which object to use from a chain of
When you wish to construct such a type you need "self-references"
references (see below).
that allow you to reference the object having this type from the
TYPE node, i.e. without having a variable instantiating this type.
When we wish to evaluate a size or offset, we check it is contains a
placeholder. If it does, we construct a WITH_RECORD_EXPR that contains
Such a "self-references" is done using a PLACEHOLDER_EXPR. This is
both the expression we wish to evaluate and an expression within which the
a node that will later be replaced with the object being referenced.
object may be found. The latter expression is the object itself in
Its type is that of the object and selects which object to use from
the simple case of an Ada record with discriminant, but it can be the
a chain of references (see below). No other slots are used in the
array in the case of an unconstrained array.
PLACEHOLDER_EXPR.
In the latter case, we need the fat pointer, because the bounds of the
For example, if your type FOO is a RECORD_TYPE with a field BAR,
array can only be accessed from it. However, we rely here on the fact that
and you need the value of <variable>.BAR to calculate TYPE_SIZE
the expression for the array contains the dereference of the fat pointer
(FOO), just substitute <variable> above with a PLACEHOLDER_EXPR
that obtained the array pointer.
what contains both the expression we wish to
evaluate and an expression within which the object may be found.
The latter expression is the object itself in the simple case of an
Ada record with discriminant, but it can be the array in the case of
an unconstrained array.
In the latter case, we need the fat pointer, because the bounds of
the array can only be accessed from it. However, we rely here on the
fact that the expression for the array contains the dereference of
the fat pointer that obtained the array pointer.
Accordingly, when looking for the object to substitute in place of
Accordingly, when looking for the object to substitute in place of
a PLACEHOLDER_EXPR, we look down the first operand of the expression
a PLACEHOLDER_EXPR, we look down the first operand of the expression
passed as the second operand to WITH_RECORD_EXPR until we find
something
passed as the second operand to WITH_RECORD_EXPR until we find
of the desired type or reach a constant. */
something
of the desired type or reach a constant. */
/* Denotes a record to later be supplied with a WITH_RECORD_EXPR when
/* Denotes a record to later be supplied with a WITH_RECORD_EXPR when
evaluating this expression. The type of this expression is used to
evaluating this expression. The type of this expression is used to
...
...
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