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
73845be1
Commit
73845be1
authored
Jun 25, 1997
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(__objc_register_instance_methods_to_class): New function.
From-SVN: r14307
parent
38692f1f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
gcc/objc/selector.c
+65
-0
No files found.
gcc/objc/selector.c
View file @
73845be1
...
...
@@ -88,6 +88,71 @@ register_selectors_from_list (MethodList_t method_list)
}
/* Register instance methods as class methods for root classes */
void
__objc_register_instance_methods_to_class
(
Class
class
)
{
MethodList_t
method_list
;
MethodList_t
class_method_list
;
int
max_methods_no
=
16
;
MethodList_t
new_list
;
Method_t
curr_method
;
/* Only if a root class. */
if
(
class
->
super_class
)
return
;
/* Allocate a method list to hold the new class methods */
new_list
=
objc_calloc
(
sizeof
(
struct
objc_method_list
)
+
sizeof
(
struct
objc_method
[
max_methods_no
]),
1
);
method_list
=
class
->
methods
;
class_method_list
=
class
->
class_pointer
->
methods
;
curr_method
=
&
new_list
->
method_list
[
0
];
/* Iterate through the method lists for the class */
while
(
method_list
)
{
int
i
;
/* Iterate through the methods from this method list */
for
(
i
=
0
;
i
<
method_list
->
method_count
;
i
++
)
{
Method_t
mth
=
&
method_list
->
method_list
[
i
];
if
(
mth
->
method_name
&&
!
search_for_method_in_list
(
class_method_list
,
mth
->
method_name
))
{
/* This instance method isn't a class method.
Add it into the new_list. */
*
curr_method
=
*
mth
;
/* Reallocate the method list if necessary */
if
(
++
new_list
->
method_count
==
max_methods_no
)
new_list
=
objc_realloc
(
new_list
,
sizeof
(
struct
objc_method_list
)
+
sizeof
(
struct
objc_method
[
max_methods_no
+=
16
]));
curr_method
=
&
new_list
->
method_list
[
new_list
->
method_count
];
}
}
method_list
=
method_list
->
method_next
;
}
/* If we created any new class methods
then attach the method list to the class */
if
(
new_list
->
method_count
)
{
new_list
=
objc_realloc
(
new_list
,
sizeof
(
struct
objc_method_list
)
+
sizeof
(
struct
objc_method
[
new_list
->
method_count
]));
new_list
->
method_next
=
class
->
class_pointer
->
methods
;
class
->
class_pointer
->
methods
=
new_list
;
}
__objc_update_dispatch_table_for_class
(
class
->
class_pointer
);
}
/* Returns YES iff t1 and t2 have same method types, but we ignore
the argframe layout */
BOOL
...
...
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