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
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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
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)
break
;
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
p2
=
gjmp
(
P
);
// p2: goto else
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