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
33da9afc
Commit
33da9afc
authored
Jun 27, 2010
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimization of static initialization
R=rsc CC=golang-dev
https://golang.org/cl/1677049
parent
56f3c701
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
202 additions
and
128 deletions
+202
-128
src/cmd/gc/go.h
src/cmd/gc/go.h
+1
-1
src/cmd/gc/reflect.c
src/cmd/gc/reflect.c
+1
-1
src/cmd/gc/sinit.c
src/cmd/gc/sinit.c
+197
-123
src/cmd/gc/walk.c
src/cmd/gc/walk.c
+3
-3
No files found.
src/cmd/gc/go.h
View file @
33da9afc
...
...
@@ -1016,7 +1016,7 @@ void walkselect(Node *sel);
/*
* sinit.c
*/
void
anylit
(
Node
*
n
,
Node
*
var
,
NodeList
**
init
);
void
anylit
(
int
ctxt
,
Node
*
n
,
Node
*
var
,
NodeList
**
init
);
int
gen_as_init
(
Node
*
n
);
NodeList
*
initfix
(
NodeList
*
l
);
int
oaslit
(
Node
*
n
,
NodeList
**
init
);
...
...
src/cmd/gc/reflect.c
View file @
33da9afc
...
...
@@ -617,7 +617,7 @@ typename(Type *t)
Sym
*
s
;
Node
*
n
;
if
((
isptr
[
t
->
etype
]
&&
t
->
type
==
T
)
||
isideal
(
t
))
if
(
t
==
T
||
(
isptr
[
t
->
etype
]
&&
t
->
type
==
T
)
||
isideal
(
t
))
fatal
(
"typename %T"
,
t
);
s
=
typesym
(
t
);
if
(
s
->
def
==
N
)
{
...
...
src/cmd/gc/sinit.c
View file @
33da9afc
This diff is collapsed.
Click to expand it.
src/cmd/gc/walk.c
View file @
33da9afc
...
...
@@ -813,7 +813,7 @@ walkexpr(Node **np, NodeList **init)
goto
ret
;
case
ODOTTYPE
:
case
ODOTTYPE2
:
case
ODOTTYPE2
:
// Build name of function: assertI2E2 etc.
strcpy
(
buf
,
"assert"
);
p
=
buf
+
strlen
(
buf
);
...
...
@@ -1081,7 +1081,7 @@ walkexpr(Node **np, NodeList **init)
case
OMAPLIT
:
case
OSTRUCTLIT
:
nvar
=
makenewvar
(
n
->
type
,
init
,
&
nstar
);
anylit
(
n
->
left
,
nstar
,
init
);
anylit
(
0
,
n
->
left
,
nstar
,
init
);
n
=
nvar
;
goto
ret
;
}
...
...
@@ -1262,7 +1262,7 @@ walkexpr(Node **np, NodeList **init)
case
OSTRUCTLIT
:
nvar
=
nod
(
OXXX
,
N
,
N
);
tempname
(
nvar
,
n
->
type
);
anylit
(
n
,
nvar
,
init
);
anylit
(
0
,
n
,
nvar
,
init
);
n
=
nvar
;
goto
ret
;
...
...
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