Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
49a835fc
Commit
49a835fc
authored
Oct 15, 2010
by
Luuk van Dijk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: keep track of real actual type of identifiers.
R=rsc CC=golang-dev
https://golang.org/cl/2519042
parent
9c204852
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
go.h
src/cmd/gc/go.h
+1
-0
subr.c
src/cmd/gc/subr.c
+5
-5
typecheck.c
src/cmd/gc/typecheck.c
+1
-0
No files found.
src/cmd/gc/go.h
View file @
49a835fc
...
...
@@ -218,6 +218,7 @@ struct Node
Node
*
left
;
Node
*
right
;
Type
*
type
;
Type
*
realtype
;
// as determined by typecheck
NodeList
*
list
;
NodeList
*
rlist
;
...
...
src/cmd/gc/subr.c
View file @
49a835fc
...
...
@@ -3607,10 +3607,11 @@ umagic(Magic *m)
Sym
*
ngotype
(
Node
*
n
)
{
if
(
n
->
sym
!=
S
&&
strncmp
(
n
->
sym
->
name
,
"autotmp_"
,
8
)
!=
0
)
if
(
n
->
type
->
etype
!=
TFUNC
||
n
->
type
->
thistuple
==
0
)
if
(
n
->
type
->
etype
!=
TSTRUCT
||
n
->
type
->
funarg
==
0
)
return
typename
(
n
->
type
)
->
left
->
sym
;
if
(
n
->
sym
!=
S
&&
n
->
realtype
!=
T
)
if
(
strncmp
(
n
->
sym
->
name
,
"autotmp_"
,
8
)
!=
0
)
if
(
strncmp
(
n
->
sym
->
name
,
"statictmp_"
,
8
)
!=
0
)
return
typename
(
n
->
realtype
)
->
left
->
sym
;
return
S
;
}
...
...
@@ -3684,4 +3685,3 @@ strlit(char *s)
t
->
len
=
strlen
(
s
);
return
t
;
}
src/cmd/gc/typecheck.c
View file @
49a835fc
...
...
@@ -112,6 +112,7 @@ typecheck(Node **np, int top)
goto
error
;
}
walkdef
(
n
);
n
->
realtype
=
n
->
type
;
if
(
n
->
op
==
ONONAME
)
goto
error
;
}
...
...
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