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
b199035b
Commit
b199035b
authored
Mar 31, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move tiny gsubr functions together at the top of the file.
delete unused mkenam file R=ken OCL=26940 CL=26940
parent
4e841748
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
75 deletions
+75
-75
gsubr.c
src/cmd/6g/gsubr.c
+75
-75
No files found.
src/cmd/6g/gsubr.c
View file @
b199035b
...
...
@@ -116,6 +116,81 @@ newplist(void)
return
pl
;
}
void
gused
(
Node
*
n
)
{
gins
(
ANOP
,
n
,
N
);
// used
}
Prog
*
gjmp
(
Prog
*
to
)
{
Prog
*
p
;
p
=
gbranch
(
AJMP
,
T
);
if
(
to
!=
P
)
patch
(
p
,
to
);
return
p
;
}
void
ggloblnod
(
Node
*
nam
,
int32
width
)
{
Prog
*
p
;
p
=
gins
(
AGLOBL
,
nam
,
N
);
p
->
lineno
=
nam
->
lineno
;
p
->
to
.
sym
=
S
;
p
->
to
.
type
=
D_CONST
;
p
->
to
.
offset
=
width
;
}
void
ggloblsym
(
Sym
*
s
,
int32
width
,
int
dupok
)
{
Prog
*
p
;
p
=
gins
(
AGLOBL
,
N
,
N
);
p
->
from
.
type
=
D_EXTERN
;
if
(
s
==
symstringo
)
p
->
from
.
type
=
D_STATIC
;
p
->
from
.
index
=
D_NONE
;
p
->
from
.
sym
=
s
;
p
->
to
.
type
=
D_CONST
;
p
->
to
.
index
=
D_NONE
;
p
->
to
.
offset
=
width
;
if
(
dupok
)
p
->
from
.
scale
=
DUPOK
;
}
int
isfat
(
Type
*
t
)
{
if
(
t
!=
T
)
switch
(
t
->
etype
)
{
case
TSTRUCT
:
case
TARRAY
:
case
TINTER
:
// maybe remove later
case
TDDD
:
// maybe remove later
return
1
;
}
return
0
;
}
/*
* naddr of func generates code for address of func.
* if using opcode that can take address implicitly,
* call afunclit to fix up the argument.
*/
void
afunclit
(
Addr
*
a
)
{
if
(
a
->
type
==
D_ADDR
&&
a
->
index
==
D_EXTERN
)
{
a
->
type
=
D_EXTERN
;
a
->
index
=
D_NONE
;
}
}
static
int
resvd
[]
=
{
// D_DI, // for movstring
...
...
@@ -1121,20 +1196,6 @@ naddr(Node *n, Addr *a)
}
}
/*
* naddr of func generates code for address of func.
* if using opcode that can take address implicitly,
* call afunclit to fix up the argument.
*/
void
afunclit
(
Addr
*
a
)
{
if
(
a
->
type
==
D_ADDR
&&
a
->
index
==
D_EXTERN
)
{
a
->
type
=
D_EXTERN
;
a
->
index
=
D_NONE
;
}
}
/*
* return Axxx for Oxxx on type t.
*/
...
...
@@ -1664,20 +1725,6 @@ optoas(int op, Type *t)
return
a
;
}
int
isfat
(
Type
*
t
)
{
if
(
t
!=
T
)
switch
(
t
->
etype
)
{
case
TSTRUCT
:
case
TARRAY
:
case
TINTER
:
// maybe remove later
case
TDDD
:
// maybe remove later
return
1
;
}
return
0
;
}
enum
{
ODynam
=
1
<<
0
,
...
...
@@ -1927,50 +1974,3 @@ no:
sudoclean
();
return
0
;
}
void
gused
(
Node
*
n
)
{
gins
(
ANOP
,
n
,
N
);
// used
}
Prog
*
gjmp
(
Prog
*
to
)
{
Prog
*
p
;
p
=
gbranch
(
AJMP
,
T
);
if
(
to
!=
P
)
patch
(
p
,
to
);
return
p
;
}
void
ggloblnod
(
Node
*
nam
,
int32
width
)
{
Prog
*
p
;
p
=
gins
(
AGLOBL
,
nam
,
N
);
p
->
lineno
=
nam
->
lineno
;
p
->
to
.
sym
=
S
;
p
->
to
.
type
=
D_CONST
;
p
->
to
.
offset
=
width
;
}
void
ggloblsym
(
Sym
*
s
,
int32
width
,
int
dupok
)
{
Prog
*
p
;
p
=
gins
(
AGLOBL
,
N
,
N
);
p
->
from
.
type
=
D_EXTERN
;
if
(
s
==
symstringo
)
p
->
from
.
type
=
D_STATIC
;
p
->
from
.
index
=
D_NONE
;
p
->
from
.
sym
=
s
;
p
->
to
.
type
=
D_CONST
;
p
->
to
.
index
=
D_NONE
;
p
->
to
.
offset
=
width
;
if
(
dupok
)
p
->
from
.
scale
=
DUPOK
;
}
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