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
410927d1
Commit
410927d1
authored
Oct 07, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: elide dead code
R=ken2 CC=golang-dev
https://golang.org/cl/2365044
parent
42c26b73
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
src/cmd/gc/gen.c
src/cmd/gc/gen.c
+11
-0
No files found.
src/cmd/gc/gen.c
View file @
410927d1
...
@@ -257,6 +257,17 @@ gen(Node *n)
...
@@ -257,6 +257,17 @@ gen(Node *n)
break
;
break
;
case
OIF
:
case
OIF
:
if
(
n
->
ntest
==
N
||
n
->
ntest
->
op
==
OLITERAL
)
{
// drop dead code in if true or if false.
// the linker will do it for us in general,
// but this avoids writnig to the object file
// in a very common case.
if
(
n
->
ntest
==
N
||
n
->
ntest
->
val
.
u
.
bval
)
genlist
(
n
->
nbody
);
else
genlist
(
n
->
nelse
);
break
;
}
p1
=
gjmp
(
P
);
// goto test
p1
=
gjmp
(
P
);
// goto test
p2
=
gjmp
(
P
);
// p2: goto else
p2
=
gjmp
(
P
);
// p2: goto else
patch
(
p1
,
pc
);
// test:
patch
(
p1
,
pc
);
// test:
...
...
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