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
9335e9a3
Commit
9335e9a3
authored
Oct 07, 1998
by
Mark Mitchell
Committed by
Mark Mitchell
Oct 07, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* class.c (finish_struct_1): Add commentary on prevous change.
From-SVN: r22884
parent
39828aec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
gcc/cp/ChangeLog
+2
-0
gcc/cp/class.c
+19
-2
No files found.
gcc/cp/ChangeLog
View file @
9335e9a3
1998-10-07 Mark Mitchell <mark@markmitchell.com>
* class.c (finish_struct_1): Add commentary on prevous change.
* cp-tree.h (vtbl_ptr_type_node): New variable.
* class.c (build_vtbl_ref): Don't indirect through the vptr; it's
already of the right type.
...
...
gcc/cp/class.c
View file @
9335e9a3
...
...
@@ -3777,8 +3777,25 @@ finish_struct_1 (t, warn_anon)
if
(
vfield
==
NULL_TREE
&&
has_virtual
)
{
/* We build this decl with ptr_type_node, and
change the type when we know what it should be. */
/* We build this decl with vtbl_ptr_type_node, which is a
`vtable_entry_type*'. It might seem more precise to use
`vtable_entry_type (*)[N]' where N is the number of firtual
functions. However, that would require the vtable pointer in
base classes to have a different type than the vtable pointer
in derived classes. We could make that happen, but that
still wouldn't solve all the problems. In particular, the
type-based alias analysis code would decide that assignments
to the base class vtable pointer can't alias assignments to
the derived class vtable pointer, since they have different
types. Thus, in an derived class destructor, where the base
class constructor was inlined, we could generate bad code for
setting up the vtable pointer.
Therefore, we use one type for all vtable pointers. We still
use a type-correct type; it's just doesn't indicate the array
bounds. That's better than using `void*' or some such; it's
cleaner, and it let's the alias analysis code know that these
stores cannot alias stores to void*! */
vfield
=
build_lang_field_decl
(
FIELD_DECL
,
get_vfield_name
(
t
),
vtbl_ptr_type_node
);
/* If you change any of the below, take a look at all the
...
...
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