Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
a8b56a73
Commit
a8b56a73
authored
Nov 05, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
T,ok = I.(T)
R=r OCL=18580 CL=18582
parent
6f07ec72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
24 deletions
+47
-24
src/cmd/gc/walk.c
src/cmd/gc/walk.c
+47
-24
No files found.
src/cmd/gc/walk.c
View file @
a8b56a73
...
@@ -14,8 +14,10 @@ enum
...
@@ -14,8 +14,10 @@ enum
{
{
Inone
,
Inone
,
I2T
,
I2T
,
I2T2
,
I2I
,
I2I
,
T2I
I2I2
,
T2I
,
};
};
// can this code branch reach the end
// can this code branch reach the end
...
@@ -463,6 +465,33 @@ loop:
...
@@ -463,6 +465,33 @@ loop:
goto
ret
;
goto
ret
;
}
}
break
;
break
;
case
OCONV
:
if
(
cl
==
2
&&
cr
==
1
)
{
// a,b = i.(T)
if
(
r
->
left
==
N
)
break
;
et
=
isandss
(
r
->
type
,
r
->
left
);
switch
(
et
)
{
case
I2T
:
et
=
I2T2
;
break
;
case
I2I
:
et
=
I2I2
;
break
;
default:
et
=
Inone
;
break
;
}
if
(
et
==
Inone
)
break
;
r
=
ifaceop
(
r
->
type
,
r
->
left
,
et
);
l
=
ascompatet
(
n
->
op
,
&
n
->
left
,
&
r
->
type
,
0
);
if
(
l
!=
N
)
indir
(
n
,
list
(
r
,
reorder2
(
l
)));
goto
ret
;
}
break
;
}
}
switch
(
l
->
op
)
{
switch
(
l
->
op
)
{
...
@@ -2667,6 +2696,15 @@ isandss(Type *lt, Node *r)
...
@@ -2667,6 +2696,15 @@ isandss(Type *lt, Node *r)
return
Inone
;
return
Inone
;
}
}
static
char
*
ifacename
[]
=
{
[
I2T
]
=
"ifaceI2T"
,
[
I2T2
]
=
"ifaceI2T2"
,
[
I2I
]
=
"ifaceI2I"
,
[
I2I2
]
=
"ifaceI2I2"
,
};
Node
*
Node
*
ifaceop
(
Type
*
tl
,
Node
*
n
,
int
op
)
ifaceop
(
Type
*
tl
,
Node
*
n
,
int
op
)
{
{
...
@@ -2678,26 +2716,7 @@ ifaceop(Type *tl, Node *n, int op)
...
@@ -2678,26 +2716,7 @@ ifaceop(Type *tl, Node *n, int op)
switch
(
op
)
{
switch
(
op
)
{
default:
default:
fatal
(
"ifaceop: unknown op %d
\n
"
,
op
);
fatal
(
"ifaceop: unknown op %O
\n
"
,
op
);
case
I2T
:
// ifaceI2T(sigt *byte, iface any) (ret any);
a
=
n
;
// interface
r
=
a
;
s
=
signame
(
tl
);
// sigi
if
(
s
==
S
)
fatal
(
"ifaceop: signame I2T"
);
a
=
s
->
oname
;
a
=
nod
(
OADDR
,
a
,
N
);
r
=
list
(
a
,
r
);
on
=
syslook
(
"ifaceI2T"
,
1
);
argtype
(
on
,
tr
);
argtype
(
on
,
tl
);
break
;
case
T2I
:
case
T2I
:
// ifaceT2I(sigi *byte, sigt *byte, elem any) (ret any);
// ifaceT2I(sigi *byte, sigt *byte, elem any) (ret any);
...
@@ -2726,22 +2745,26 @@ ifaceop(Type *tl, Node *n, int op)
...
@@ -2726,22 +2745,26 @@ ifaceop(Type *tl, Node *n, int op)
break
;
break
;
case
I2T
:
case
I2T2
:
case
I2I
:
case
I2I
:
// ifaceI2I(sigi *byte, iface any-1) (ret any-2);
case
I2I2
:
// iface[IT]2[IT][2](sigt *byte, iface any) (ret any[, ok bool]);
a
=
n
;
// interface
a
=
n
;
// interface
r
=
a
;
r
=
a
;
s
=
signame
(
tl
);
// sigi
s
=
signame
(
tl
);
// sigi
if
(
s
==
S
)
if
(
s
==
S
)
fatal
(
"ifaceop: signame
I2I"
);
fatal
(
"ifaceop: signame
%d"
,
op
);
a
=
s
->
oname
;
a
=
s
->
oname
;
a
=
nod
(
OADDR
,
a
,
N
);
a
=
nod
(
OADDR
,
a
,
N
);
r
=
list
(
a
,
r
);
r
=
list
(
a
,
r
);
on
=
syslook
(
"ifaceI2I"
,
1
);
on
=
syslook
(
ifacename
[
op
]
,
1
);
argtype
(
on
,
tr
);
argtype
(
on
,
tr
);
argtype
(
on
,
tl
);
argtype
(
on
,
tl
);
break
;
break
;
case
OEQ
:
case
OEQ
:
...
...
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