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
cbf882af
Commit
cbf882af
authored
Dec 10, 1998
by
Mark Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(start_enum): Use push_obstacks, not end_temporary_allocation.
(finish_enum): Call pop_obstacks. From-SVN: r24243
parent
513e9d13
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
52 deletions
+45
-52
gcc/cp/decl.c
+45
-52
No files found.
gcc/cp/decl.c
View file @
cbf882af
...
@@ -12205,11 +12205,7 @@ start_enum (name)
...
@@ -12205,11 +12205,7 @@ start_enum (name)
/* We are wasting space here and putting these on the permanent_obstack so
/* We are wasting space here and putting these on the permanent_obstack so
that typeid(local enum) will work correctly. */
that typeid(local enum) will work correctly. */
#if 0
push_obstacks
(
&
permanent_obstack
,
&
permanent_obstack
);
if (processing_template_decl && current_function_decl)
#endif
end_temporary_allocation
();
/* If this is the real definition for a previous forward reference,
/* If this is the real definition for a previous forward reference,
fill in the contents in the same object that used to be the
fill in the contents in the same object that used to be the
...
@@ -12311,61 +12307,58 @@ finish_enum (enumtype)
...
@@ -12311,61 +12307,58 @@ finish_enum (enumtype)
{
{
tree
scope
=
current_scope
();
tree
scope
=
current_scope
();
if
(
scope
&&
TREE_CODE
(
scope
)
==
FUNCTION_DECL
)
if
(
scope
&&
TREE_CODE
(
scope
)
==
FUNCTION_DECL
)
{
add_tree
(
build_min
(
TAG_DEFN
,
enumtype
));
add_tree
(
build_min
(
TAG_DEFN
,
enumtype
));
resume_temporary_allocation
();
}
return
enumtype
;
}
}
else
{
int
unsignedp
=
tree_int_cst_sgn
(
minnode
)
>=
0
;
int
lowprec
=
min_precision
(
minnode
,
unsignedp
);
int
highprec
=
min_precision
(
maxnode
,
unsignedp
);
int
precision
=
MAX
(
lowprec
,
highprec
);
tree
tem
;
{
TYPE_SIZE
(
enumtype
)
=
NULL_TREE
;
int
unsignedp
=
tree_int_cst_sgn
(
minnode
)
>=
0
;
int
lowprec
=
min_precision
(
minnode
,
unsignedp
);
int
highprec
=
min_precision
(
maxnode
,
unsignedp
);
int
precision
=
MAX
(
lowprec
,
highprec
);
TYPE_SIZE
(
enumtype
)
=
NULL_TREE
;
/* Set TYPE_MIN_VALUE and TYPE_MAX_VALUE according to `precision'. */
TYPE_PRECISION
(
enumtype
)
=
precision
;
/* Set TYPE_MIN_VALUE and TYPE_MAX_VALUE according to `precision'. */
if
(
unsignedp
)
fixup_unsigned_type
(
enumtype
);
else
fixup_signed_type
(
enumtype
);
if
(
flag_short_enums
||
(
precision
>
TYPE_PRECISION
(
integer_type_node
)))
TYPE_PRECISION
(
enumtype
)
=
precision
;
/* Use the width of the narrowest normal C type which is wide enough. */
if
(
unsignedp
)
TYPE_PRECISION
(
enumtype
)
=
TYPE_PRECISION
(
type_for_size
fixup_unsigned_type
(
enumtype
);
(
precision
,
1
));
else
else
fixup_signed_type
(
enumtype
);
TYPE_PRECISION
(
enumtype
)
=
TYPE_PRECISION
(
integer_type_node
);
TYPE_SIZE
(
enumtype
)
=
0
;
if
(
flag_short_enums
||
(
precision
>
TYPE_PRECISION
(
integer_type_node
)))
layout_type
(
enumtype
);
/* Use the width of the narrowest normal C type which is wide
}
enough. */
TYPE_PRECISION
(
enumtype
)
=
TYPE_PRECISION
(
type_for_size
(
precision
,
1
));
else
TYPE_PRECISION
(
enumtype
)
=
TYPE_PRECISION
(
integer_type_node
);
{
TYPE_SIZE
(
enumtype
)
=
0
;
register
tree
tem
;
layout_type
(
enumtype
)
;
/* Fix up all variant types of this enum type. */
/* Fix up all variant types of this enum type. */
for
(
tem
=
TYPE_MAIN_VARIANT
(
enumtype
);
tem
;
for
(
tem
=
TYPE_MAIN_VARIANT
(
enumtype
);
tem
;
tem
=
TYPE_NEXT_VARIANT
(
tem
))
tem
=
TYPE_NEXT_VARIANT
(
tem
))
{
{
TYPE_VALUES
(
tem
)
=
TYPE_VALUES
(
enumtype
);
TYPE_VALUES
(
tem
)
=
TYPE_VALUES
(
enumtype
);
TYPE_MIN_VALUE
(
tem
)
=
TYPE_MIN_VALUE
(
enumtype
);
TYPE_MIN_VALUE
(
tem
)
=
TYPE_MIN_VALUE
(
enumtype
);
TYPE_MAX_VALUE
(
tem
)
=
TYPE_MAX_VALUE
(
enumtype
);
TYPE_MAX_VALUE
(
tem
)
=
TYPE_MAX_VALUE
(
enumtype
);
TYPE_SIZE
(
tem
)
=
TYPE_SIZE
(
enumtype
);
TYPE_SIZE
(
tem
)
=
TYPE_SIZE
(
enumtype
);
TYPE_SIZE_UNIT
(
tem
)
=
TYPE_SIZE_UNIT
(
enumtype
);
TYPE_SIZE_UNIT
(
tem
)
=
TYPE_SIZE_UNIT
(
enumtype
);
TYPE_MODE
(
tem
)
=
TYPE_MODE
(
enumtype
);
TYPE_MODE
(
tem
)
=
TYPE_MODE
(
enumtype
);
TYPE_PRECISION
(
tem
)
=
TYPE_PRECISION
(
enumtype
);
TYPE_PRECISION
(
tem
)
=
TYPE_PRECISION
(
enumtype
);
TYPE_ALIGN
(
tem
)
=
TYPE_ALIGN
(
enumtype
);
TYPE_ALIGN
(
tem
)
=
TYPE_ALIGN
(
enumtype
);
TREE_UNSIGNED
(
tem
)
=
TREE_UNSIGNED
(
enumtype
);
TREE_UNSIGNED
(
tem
)
=
TREE_UNSIGNED
(
enumtype
);
}
}
}
/* Finish debugging output for this type. */
/* Finish debugging output for this type. */
rest_of_type_compilation
(
enumtype
,
namespace_bindings_p
());
rest_of_type_compilation
(
enumtype
,
namespace_bindings_p
());
}
/* In start_enum we pushed obstacks. Here, we must pop them. */
pop_obstacks
();
return
enumtype
;
return
enumtype
;
}
}
...
...
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