register struct stentry
*s
;
/* print procedure statement and argument list */
for(p
= prevcomments
; p
; p
= p
->nextp
)
fprintf(codefile
, "%s\n", sp
+1);
fprintf(codefile
, "%s\n", tailor
.procheader
);
if(procname
->vtype
==TYSUBR
|| procname
->vtype
==TYUNDEFINED
)
p2str(types
[procname
->vtype
]);
p2str(procname
->sthead
->namep
);
else if(procclass
== PRBLOCK
)
if(tailor
.ftnsys
== CRAY
)
for(p
= thisargs
; p
; p
= p
->nextp
)
if( (q
=p
->datap
)->vextbase
)
p2str(ftnames
[q
->vextbase
]);
else for(i
=0 ; i
<NFTNTYPES
; ++i
)
/* first put out declarations of variables that are used as
for(hp
= hashtab
; hp
<hashend
; ++hp
)
if( *hp
&& (q
= (*hp
)->varp
) )
if(q
->tag
==TNAME
&& q
->vadjdim
&& q
!=procname
)
z
= z
->nextp
= mkchain(q
,CHNULL
);
/* then declare the rest of the arguments */
for(p
= thisargs
; p
; p
= p
->nextp
)
if(p
->datap
->vadjdim
== 0)
z
= z
->nextp
= mkchain(p
->datap
,CHNULL
);
/* now put out declarations for common blocks */
for(p
= commonlist
; p
; p
= p
->nextp
)
TEST
fprintf(diagfile
, "\nend of common declarations");
/* next the other variables that are in the symbol table */
for(hp
= hashtab
; hp
<hashend
; ++hp
)
if( *hp
&& (q
= (*hp
)->varp
) )
if(q
->tag
==TNAME
&& q
->vadjdim
==0 && q
->vclass
!=CLCOMMON
&&
q
->vclass
!=CLARG
&& q
!=procname
&&
(tailor
.dclintrinsics
|| q
->vproc
!=PROCINTRINSIC
) )
z
= z
->nextp
= mkchain(q
,CHNULL
);
TEST
fprintf(diagfile
, "\nend of symbol table, start of gonelist");
/* now declare variables that are no longer in the symbol table */
dclchain(gonelist
, NOCOMMON
);
TEST
fprintf(diagfile
, "\nbeginning of hidlist");
dclchain(hidlist
, NOCOMMON
);
dclchain(tempvarlist
, NOCOMMON
);
/* finally put out equivalence statements that are generated
because of structure and character variables
for(p
= genequivs
; p
; p
= p
->nextp
)
for(i
=0; i
<NFTNTYPES
; ++i
)
p2str(ftnames
[ q
->vbase
[i
] ]);
for(q1
= q1
->datap
; q1
; q1
= q1
->nextp
)
for(q
= p
->comchain
; q
; q
= q
->nextp
)
dclchain(p
->comchain
, DOCOMMON
);
for(i
=0; i
<NFTNTYPES
; ++i
)
p2str(ftnames
[p
->vbase
[i
]]);
fatal1("prname: no fortran types for name %s",
for(i
=0; i
<NFTNTYPES
; ++i
)
p2str(ftnames
[p
->vbase
[i
]]);
badtag("prname", p
->tag
);
for(pn
= chp
; pn
; pn
= pn
->nextp
)
if( (p
->tag
==TNAME
|| p
->tag
==TTEMP
) && p
->vext
!=0)
if(nline
%NAMESPERLINE
== 0)
p2str(ftnames
[p
->vextbase
]);
for(pn
= chp
; pn
; pn
= pn
->nextp
)
if( (p
->tag
==TNAME
|| p
->tag
==TTEMP
) &&
p
->vtype
==TYSTRUCT
&& p
->vclass
!=CLARG
)
for(i
=0; i
<NFTNTYPES
; ++i
)
genequivs
= mkchain(p
, genequivs
);
for(i
=0; i
<NFTNTYPES
; ++i
)
for(pn
= chp
; pn
; pn
= pn
->nextp
)
if( (p
->tag
==TNAME
|| p
->tag
==TTEMP
) &&
p
->vtype
!=TYSUBR
&& p
->vbase
[i
]!=0 &&
(okcom
|| p
->vclass
!=CLCOMMON
) )
if(nline
%NAMESPERLINE
== 0)
p2str(ftnames
[p
->vbase
[i
]]);
if(p
->vtype
==TYCHAR
|| p
->vtype
==TYSTRUCT
||
(p
->vtype
==TYLCOMPLEX
&& tailor
.lngcxtype
==NULL
))
sizalign(p
, &size
,&align
,&mask
);
p2int( size
/tailor
.ftnsize
[i
] );
for(q
= q
->datap
; q
; q
= q
->nextp
)
v
= fold( mknode(TAROP
,OPMINUS
,
mkint(1),cpexpr(q
->lowerb
)) );
v
= fold( mknode(TAROP
,OPPLUS
,
v
= q
->upperb
= simple(RVAL
,q
->upperb
);
if( (v
->tag
==TNAME
&& v
->vclass
==CLARG
) ||
(isicon(v
,&subval
) && subval
>0) )
else dclerr("invalid array bound",