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
b6c056fe
Commit
b6c056fe
authored
Apr 17, 2010
by
Eric Botcazou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing hunk for previous patch.
From-SVN: r158467
parent
728936bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
31 deletions
+37
-31
gcc/ada/gcc-interface/decl.c
+37
-31
No files found.
gcc/ada/gcc-interface/decl.c
View file @
b6c056fe
...
@@ -1889,55 +1889,59 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
...
@@ -1889,55 +1889,59 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
char
field_name
[
16
];
char
field_name
[
16
];
tree
gnu_index_base_type
tree
gnu_index_base_type
=
get_unpadded_type
(
Base_Type
(
Etype
(
gnat_index
)));
=
get_unpadded_type
(
Base_Type
(
Etype
(
gnat_index
)));
tree
gnu_low_field
,
gnu_high_field
,
gnu_low
,
gnu_high
,
gnu_max
;
tree
gnu_lb_field
,
gnu_hb_field
,
gnu_orig_min
,
gnu_orig_max
;
tree
gnu_min
,
gnu_max
,
gnu_high
;
/* Make the FIELD_DECLs for the low and high bounds of this
/* Make the FIELD_DECLs for the low and high bounds of this
type and then make extractions of these fields from the
type and then make extractions of these fields from the
template. */
template. */
sprintf
(
field_name
,
"LB%d"
,
index
);
sprintf
(
field_name
,
"LB%d"
,
index
);
gnu_l
ow
_field
=
create_field_decl
(
get_identifier
(
field_name
),
gnu_l
b
_field
=
create_field_decl
(
get_identifier
(
field_name
),
gnu_index_base_type
,
gnu_index_base_type
,
gnu_template_type
,
0
,
gnu_template_type
,
0
,
NULL_TREE
,
NULL_TREE
,
0
);
NULL_TREE
,
NULL_TREE
,
0
);
Sloc_to_locus
(
Sloc
(
gnat_entity
),
Sloc_to_locus
(
Sloc
(
gnat_entity
),
&
DECL_SOURCE_LOCATION
(
gnu_l
ow
_field
));
&
DECL_SOURCE_LOCATION
(
gnu_l
b
_field
));
field_name
[
0
]
=
'U'
;
field_name
[
0
]
=
'U'
;
gnu_h
igh
_field
=
create_field_decl
(
get_identifier
(
field_name
),
gnu_h
b
_field
=
create_field_decl
(
get_identifier
(
field_name
),
gnu_index_base_type
,
gnu_index_base_type
,
gnu_template_type
,
0
,
gnu_template_type
,
0
,
NULL_TREE
,
NULL_TREE
,
0
);
NULL_TREE
,
NULL_TREE
,
0
);
Sloc_to_locus
(
Sloc
(
gnat_entity
),
Sloc_to_locus
(
Sloc
(
gnat_entity
),
&
DECL_SOURCE_LOCATION
(
gnu_h
igh
_field
));
&
DECL_SOURCE_LOCATION
(
gnu_h
b
_field
));
gnu_temp_fields
[
index
]
=
chainon
(
gnu_l
ow_field
,
gnu_high
_field
);
gnu_temp_fields
[
index
]
=
chainon
(
gnu_l
b_field
,
gnu_hb
_field
);
/* We can't use build_component_ref here since the template type
/* We can't use build_component_ref here since the template type
isn't complete yet. */
isn't complete yet. */
gnu_low
=
build3
(
COMPONENT_REF
,
gnu_index_base_type
,
gnu_orig_min
=
build3
(
COMPONENT_REF
,
gnu_index_base_type
,
gnu_template_reference
,
gnu_low_field
,
gnu_template_reference
,
gnu_lb_field
,
NULL_TREE
);
NULL_TREE
);
gnu_high
=
build3
(
COMPONENT_REF
,
gnu_index_base_type
,
gnu_orig_max
=
build3
(
COMPONENT_REF
,
gnu_index_base_type
,
gnu_template_reference
,
gnu_high_field
,
gnu_template_reference
,
gnu_hb_field
,
NULL_TREE
);
NULL_TREE
);
TREE_READONLY
(
gnu_low
)
=
TREE_READONLY
(
gnu_high
)
=
1
;
TREE_READONLY
(
gnu_orig_min
)
=
TREE_READONLY
(
gnu_orig_max
)
=
1
;
/* Compute the size of this dimension. */
gnu_min
=
convert
(
sizetype
,
gnu_orig_min
);
gnu_max
gnu_max
=
convert
(
sizetype
,
gnu_orig_max
);
=
build3
(
COND_EXPR
,
gnu_index_base_type
,
build2
(
GE_EXPR
,
boolean_type_node
,
gnu_high
,
gnu_low
),
/* Compute the size of this dimension. See the E_Array_Subtype
gnu_high
,
case below for the rationale. */
build2
(
MINUS_EXPR
,
gnu_index_base_type
,
gnu_high
gnu_low
,
fold_convert
(
gnu_index_base_type
,
=
build3
(
COND_EXPR
,
sizetype
,
integer_one_node
)));
build2
(
GE_EXPR
,
boolean_type_node
,
gnu_orig_max
,
gnu_orig_min
),
gnu_max
,
size_binop
(
MINUS_EXPR
,
gnu_min
,
size_one_node
));
/* Make a range type with the new range in the Ada base type.
/* Make a range type with the new range in the Ada base type.
Then make an index type with the size range in sizetype. */
Then make an index type with the size range in sizetype. */
gnu_index_types
[
index
]
gnu_index_types
[
index
]
=
create_index_type
(
convert
(
sizetype
,
gnu_low
),
=
create_index_type
(
gnu_min
,
gnu_high
,
convert
(
sizetype
,
gnu_max
),
create_range_type
(
gnu_index_base_type
,
create_range_type
(
gnu_index_base_type
,
gnu_low
,
gnu_high
),
gnu_orig_min
,
gnu_orig_max
),
gnat_entity
);
gnat_entity
);
/* Update the maximum size of the array in elements. */
/* Update the maximum size of the array in elements. */
...
@@ -2209,6 +2213,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
...
@@ -2209,6 +2213,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
size_binop
(
MINUS_EXPR
,
gnu_min
,
size_binop
(
MINUS_EXPR
,
gnu_min
,
size_one_node
));
size_one_node
));
/* Reuse the index type for the range type. Then make an index
type with the size range in sizetype. */
gnu_index_types
[
index
]
gnu_index_types
[
index
]
=
create_index_type
(
gnu_min
,
gnu_high
,
gnu_index_type
,
=
create_index_type
(
gnu_min
,
gnu_high
,
gnu_index_type
,
gnat_entity
);
gnat_entity
);
...
...
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