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
5286a9ce
Commit
5286a9ce
authored
Oct 29, 2001
by
Nicola Pero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(GNU runtime only) statically type `self' in a class method context to be
the class the method belongs to From-SVN: r46612
parent
4ff3bd5f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
gcc/objc/objc-act.c
+14
-11
No files found.
gcc/objc/objc-act.c
View file @
5286a9ce
...
...
@@ -4710,14 +4710,16 @@ receiver_is_class_object (receiver)
{
tree
chain
,
exp
,
arg
;
/* The receiver is 'self' in the context of a class method. */
if
(
objc_method_context
&&
receiver
==
self_decl
&&
TREE_CODE
(
objc_method_context
)
==
CLASS_METHOD_DECL
)
{
return
CLASS_NAME
(
objc_implementation_context
);
}
if
(
flag_next_runtime
)
{
/* The receiver is 'self' in the context of a class method. */
if
(
objc_method_context
&&
receiver
==
self_decl
&&
TREE_CODE
(
objc_method_context
)
==
CLASS_METHOD_DECL
)
return
CLASS_NAME
(
objc_implementation_context
);
/* The receiver is a variable created by
build_class_reference_decl. */
if
(
TREE_CODE
(
receiver
)
==
VAR_DECL
...
...
@@ -4731,7 +4733,8 @@ receiver_is_class_object (receiver)
{
/* The receiver is a function call that returns an id. Check if
it is a call to objc_getClass, if so, pick up the class name. */
if
((
exp
=
TREE_OPERAND
(
receiver
,
0
))
if
(
TREE_CODE
(
receiver
)
==
CALL_EXPR
&&
(
exp
=
TREE_OPERAND
(
receiver
,
0
))
&&
TREE_CODE
(
exp
)
==
ADDR_EXPR
&&
(
exp
=
TREE_OPERAND
(
exp
,
0
))
&&
TREE_CODE
(
exp
)
==
FUNCTION_DECL
...
...
@@ -4844,8 +4847,8 @@ finish_message_expr (receiver, sel_name, method_params)
&&
TREE_STATIC_TEMPLATE
(
TREE_TYPE
(
rtype
)))
statically_typed
=
1
;
else
if
((
flag_next_runtime
||
(
TREE_CODE
(
receiver
)
==
CALL_EXPR
&&
IS_ID
(
rtype
))
)
&&
(
class_ident
=
receiver_is_class_object
(
receiver
)))
||
(
IS_ID
(
rtype
)
&&
(
class_ident
=
receiver_is_class_object
(
receiver
))
)))
;
else
if
(
!
IS_ID
(
rtype
)
/* Allow any type that matches objc_class_type. */
...
...
@@ -5022,9 +5025,9 @@ finish_message_expr (receiver, sel_name, method_params)
/* We think we have an instance...loophole: extern id Object; */
hsh
=
hash_lookup
(
nst_method_hash_list
,
sel_name
);
if
(
!
hsh
)
/* For various loopholes, like sending messages to self in a
factory context. */
/* For various loopholes */
hsh
=
hash_lookup
(
cls_method_hash_list
,
sel_name
);
method_prototype
=
check_duplicates
(
hsh
);
...
...
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