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
392202b0
Commit
392202b0
authored
Apr 22, 1993
by
Tom Wood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
From-SVN: r4192
parent
a0825a7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
33 deletions
+26
-33
gcc/c-typeck.c
+8
-22
gcc/objc/objc-act.c
+18
-11
No files found.
gcc/c-typeck.c
View file @
392202b0
...
...
@@ -461,7 +461,8 @@ comptypes (type1, type2)
}
case
RECORD_TYPE
:
return
maybe_objc_comptypes
(
t1
,
t2
,
0
);
if
(
maybe_objc_comptypes
(
t1
,
t2
,
0
)
==
1
)
return
1
;
}
return
0
;
}
...
...
@@ -473,29 +474,14 @@ static int
comp_target_types
(
ttl
,
ttr
)
tree
ttl
,
ttr
;
{
int
val
=
0
;
if
(
doing_objc_thang
)
{
/* Give maybe_objc_comptypes a crack at letting these types through. */
val
=
maybe_objc_comptypes
(
ttl
,
ttr
,
1
);
int
val
;
if
(
val
!=
1
&&
!
pedantic
)
{
/* Ignore pointer qualifiers recursively. This way char **
and const char ** are compatible. */
if
(
TREE_CODE
(
ttl
)
==
POINTER_TYPE
&&
TREE_CODE
(
ttr
)
==
POINTER_TYPE
)
return
comp_target_types
(
TYPE_MAIN_VARIANT
(
TREE_TYPE
(
ttl
)),
TYPE_MAIN_VARIANT
(
TREE_TYPE
(
ttr
)));
else
return
comptypes
(
ttl
,
ttr
);
}
}
/* Give maybe_objc_comptypes a crack at letting these types through. */
if
(
val
=
maybe_objc_comptypes
(
ttl
,
ttr
,
1
)
>=
0
)
return
val
;
if
(
val
!=
1
)
val
=
comptypes
(
TYPE_MAIN_VARIANT
(
TREE_TYPE
(
ttl
)),
TYPE_MAIN_VARIANT
(
TREE_TYPE
(
ttr
)));
val
=
comptypes
(
TYPE_MAIN_VARIANT
(
TREE_TYPE
(
ttl
)),
TYPE_MAIN_VARIANT
(
TREE_TYPE
(
ttr
)));
if
(
val
==
2
&&
pedantic
)
pedwarn
(
"types are not quite compatible"
);
...
...
gcc/objc/objc-act.c
View file @
392202b0
...
...
@@ -577,15 +577,17 @@ define_decl (declarator, declspecs)
return
decl
;
}
/* Rules for statically typed objects. Called from comptypes,
convert_for_assignment, and comp_target_types.
/* Return 1 if LHS and RHS are compatible types for assignment or
various other operations. Return 0 if they are incompatible, and
return -1 if we choose to not decide. When the operation is
REFLEXIVE, check for compatibility in either direction.
An assignment of the form `a' = `b' is permitted if:
For statically typed objects, an assignment of the form `a' = `b'
is permitted if:
- `a' is of type "id".
- `a' and `b' are the same class type.
- `a' and `b' are of class types A and B such that B is a descendant
of A. */
`a' is of type "id",
`a' and `b' are the same class type, or
`a' and `b' are of class types A and B such that B is a descendant of A. */
int
maybe_objc_comptypes
(
lhs
,
rhs
,
reflexive
)
...
...
@@ -594,7 +596,7 @@ maybe_objc_comptypes (lhs, rhs, reflexive)
{
if
(
doing_objc_thang
)
return
objc_comptypes
(
lhs
,
rhs
,
reflexive
);
return
0
;
return
-
1
;
}
static
tree
...
...
@@ -662,6 +664,11 @@ lookup_protocol_in_reflist (rproto_list, lproto)
return
0
;
}
/* Return 1 if LHS and RHS are compatible types for assignment
or various other operations. Return 0 if they are incompatible,
and return -1 if we choose to not decide. When the operation
is REFLEXIVE, check for compatibility in either direction. */
int
objc_comptypes
(
lhs
,
rhs
,
reflexive
)
tree
lhs
;
...
...
@@ -752,12 +759,12 @@ objc_comptypes (lhs, rhs, reflexive)
return
1
;
/* one of the types is a protocol */
}
else
return
2
;
/* defer to comptypes */
return
-
1
;
/* defer to comptypes */
}
else
if
(
TREE_CODE
(
lhs
)
==
RECORD_TYPE
&&
TREE_CODE
(
rhs
)
==
RECORD_TYPE
)
;
/* fall thru...this is the case we have been handling all along */
else
return
2
;
/* defer to comptypes */
return
-
1
;
/* defer to comptypes */
/* End of new protocol support. */
...
...
@@ -803,7 +810,7 @@ objc_comptypes (lhs, rhs, reflexive)
return
0
;
}
else
return
0
;
return
-
1
;
/* defer to comptypes */
}
/* Called from c-decl.c before all calls to rest_of_decl_compilation. */
...
...
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