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
1ee83f85
Commit
1ee83f85
authored
Nov 17, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: change "can we const evaluate this" from blacklist to whitelist
R=ken2
https://golang.org/cl/155074
parent
44e51fad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
6 deletions
+30
-6
const.c
src/cmd/gc/const.c
+30
-6
No files found.
src/cmd/gc/const.c
View file @
1ee83f85
...
@@ -329,14 +329,38 @@ evconst(Node *n)
...
@@ -329,14 +329,38 @@ evconst(Node *n)
Val
v
;
Val
v
;
Mpint
b
;
Mpint
b
;
// pick off just the opcodes that can be
// constant evaluated.
switch
(
n
->
op
)
{
switch
(
n
->
op
)
{
case
OMAKE
:
default:
case
OMAKEMAP
:
case
OMAKESLICE
:
case
OMAKECHAN
:
case
ODCLCONST
:
case
OCONVIFACE
:
return
;
return
;
case
OADD
:
case
OADDSTR
:
case
OAND
:
case
OANDAND
:
case
OANDNOT
:
case
OARRAYBYTESTR
:
case
OCOM
:
case
OCONV
:
case
ODIV
:
case
OEQ
:
case
OGE
:
case
OGT
:
case
OLE
:
case
OLSH
:
case
OLT
:
case
OMINUS
:
case
OMOD
:
case
OMUL
:
case
ONE
:
case
ONOT
:
case
OOR
:
case
OOROR
:
case
OPLUS
:
case
ORSH
:
case
OSUB
:
case
OXOR
:
break
;
}
}
nl
=
n
->
left
;
nl
=
n
->
left
;
...
...
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