Skip to content

Commit 0ed5339

Browse files
committed
finish dtemplate.d, remove template.c
1 parent 55054a2 commit 0ed5339

3 files changed

Lines changed: 18 additions & 6317 deletions

File tree

dm/src/dmc/dtemplate.d

Lines changed: 16 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -63,46 +63,17 @@ alias MEM_PARF_FREE = mem_free;
6363
alias MEM_PARF_STRDUP = mem_strdup;
6464

6565

66-
67-
/*private*/ int template_isclasstemplate(int);
68-
/*private*/ void template_class_decl(Classsym *stag, param_t *temp_arglist, param_t *temp_arglist2, int member_template, uint access_specifier);
69-
/*private*/ void template_function_decl(Classsym *stag, param_t *temp_arglist, param_t *temp_arglist2, int member_template, uint access_specifier,
70-
token_t *tbody, token_t *to, Symbol *s);
71-
/*private*/ Symbol * template_define(Classsym *stag, Symbol *sprimary, enum_TK tk, int structflags, char *vident, param_t *temp_arglist, param_t *ptal);
72-
/*private*/ void template_chkarg(type *, param_t *, char *);
73-
/*private*/ void template_createargtab(param_t *);
74-
/*private*/ void template_deleteargtab();
75-
/*private*/ Classsym * template_parsebody( Classsym *stag, Symbol *stempl, param_t *arglist );
76-
/*private*/ int template_elemdependent(elem *e, param_t *ptpl);
77-
/*private*/ int template_typedependent(type *t, param_t *ptpl);
78-
/*private*/ Classsym *template_expand2(Symbol *stempl, param_t *template_argument_list);
79-
/*private*/ elem *template_resolve_idents(elem *e, param_t *ptal);
80-
Symbol *template_class_match(Symbol *sprimary, param_t *ptal, param_t **pptali);
81-
void template_explicit_instantiation();
82-
83-
void template_instantiate_classmember(Symbol *st, TMF *tmf);
84-
void template_instantiate_classmember(Symbol *st, Symbol *si);
85-
86-
int template_deduce_ptal2(param_t *ptpl, match_t matchStage,
87-
int flags, param_t *pproto, param_t *pl, param_t **pptal);
88-
int template_class_leastAsSpecialized(Symbol *st1, Symbol *st2);
89-
/*private*/ int template_typedependent( type *t );
90-
Classsym *template_inscope(Symbol *s);
91-
92-
extern __gshared
66+
__gshared
9367
{
9468
symlist_t template_ftlist; // list of template function symbols
9569
Symbol *template_class_list;
9670
Symbol **template_class_list_p;
9771

98-
/*private*/ list_t template_xlist;
72+
private list_t template_xlist;
9973
}
10074

10175
type* tserr(); // { return tstypes[TYint]; }
10276

103-
version (none)
104-
{
105-
}
10677

10778
/**************************************
10879
* Parse command line switches for templates.
@@ -145,7 +116,7 @@ int template_getcmd(char *p)
145116
* parameter list
146117
*/
147118

148-
/*private*/ param_t *template_parameter_list()
119+
private param_t *template_parameter_list()
149120
{
150121
param_t **pp;
151122
param_t *temp_arglist;
@@ -455,7 +426,7 @@ void template_declaration(Classsym *stag, uint access_specifier)
455426
* 0 function template
456427
*/
457428

458-
/*private*/ int template_isclasstemplate(int member_template)
429+
private int template_isclasstemplate(int member_template)
459430
{
460431
Token_lookahead tla;
461432
int arglist;
@@ -539,7 +510,7 @@ Lisfunc:
539510
* Parse a class template declaration.
540511
*/
541512

542-
/*private*/ void template_class_decl(
513+
private void template_class_decl(
543514
Classsym *stag, // != null means member template class
544515
param_t *temp_arglist, // template parameter list
545516
param_t *temp_arglist2, // member template parameter list
@@ -1044,7 +1015,7 @@ Lerr:
10441015
* template<class T> T& vector<T>::xyzzy;
10451016
*/
10461017

1047-
/*private*/ void template_function_decl(
1018+
private void template_function_decl(
10481019
Classsym *stag, // != null means member template member function
10491020
param_t *temp_arglist, // template parameter list
10501021
param_t *temp_arglist2, // member template parameter list
@@ -2182,7 +2153,7 @@ Symbol *template_createsym(const(char)* id, type *t, Symbol **proot)
21822153
* the type structure.
21832154
*/
21842155

2185-
/*private*/ void template_createargtab(param_t *ptpl)
2156+
private void template_createargtab(param_t *ptpl)
21862157
{ Symbol *root;
21872158
int sequence = 0;
21882159

@@ -2231,7 +2202,7 @@ Symbol *template_createsym(const(char)* id, type *t, Symbol **proot)
22312202
* Remove symbol table created by template_createargtab().
22322203
*/
22332204

2234-
/*private*/ void template_deleteargtab()
2205+
private void template_deleteargtab()
22352206
{ Symbol *root;
22362207

22372208
assert(scope_end.sctype == SCTtemparg);
@@ -2251,7 +2222,7 @@ static if (0)
22512222
* tk = TKstruct, TKclass, TKunion
22522223
*/
22532224

2254-
/*private*/ Symbol * template_define(Classsym *stag, Symbol *sprimary, enum_TK tk, int structflags, char *vident, param_t *temp_arglist, param_t *ptal)
2225+
private Symbol * template_define(Classsym *stag, Symbol *sprimary, enum_TK tk, int structflags, char *vident, param_t *temp_arglist, param_t *ptal)
22552226
{ Symbol *s;
22562227
type *t;
22572228
uint sct;
@@ -3558,7 +3529,7 @@ void template_instantiate_forward(Classsym *stag)
35583529
*/
35593530

35603531

3561-
/*private*/ Classsym * template_parsebody(Classsym *stag, Symbol *stempl, param_t *arglist)
3532+
private Classsym * template_parsebody(Classsym *stag, Symbol *stempl, param_t *arglist)
35623533
{
35633534
Scope *scsave;
35643535
type *t;
@@ -3691,7 +3662,7 @@ Classsym *template_expand(Symbol *s,int flag)
36913662
* template_argument_list: <int*>
36923663
*/
36933664

3694-
/*private*/ Classsym *template_expand2(Symbol *stempl, param_t *template_argument_list)
3665+
private Classsym *template_expand2(Symbol *stempl, param_t *template_argument_list)
36953666
{
36963667
symlist_t sl;
36973668
Classsym *si;
@@ -4451,7 +4422,7 @@ int template_match_expanded_type(
44514422
* Mark any that are found.
44524423
*/
44534424

4454-
/*private*/ void template_chkarg(type *t,param_t *temp_arglist, char *temp_used)
4425+
private void template_chkarg(type *t,param_t *temp_arglist, char *temp_used)
44554426
{ param_t *p;
44564427
tym_t ty;
44574428
char *id;
@@ -4515,7 +4486,7 @@ int template_match_expanded_type(
45154486
* Return !=0 if type depends on a TYident or a template.
45164487
*/
45174488

4518-
/*private*/ int template_typedependent( type *t )
4489+
private int template_typedependent( type *t )
45194490
{
45204491
tym_t ty;
45214492
param_t *p;
@@ -4561,7 +4532,7 @@ int template_match_expanded_type(
45614532
* !=0 error
45624533
*/
45634534

4564-
/*private*/ int template_elemdependent(elem *e, param_t *ptpl)
4535+
private int template_elemdependent(elem *e, param_t *ptpl)
45654536
{ int error = 0;
45664537

45674538
while (!OTleaf(e.Eoper))
@@ -4583,7 +4554,7 @@ int template_match_expanded_type(
45834554
return error;
45844555
}
45854556

4586-
/*private*/ int template_typedependent(type *t, param_t *ptpl)
4557+
private int template_typedependent(type *t, param_t *ptpl)
45874558
{
45884559
// BUG: this code should be more like template_tyident(), which
45894560
// handles a lot more cases.
@@ -5381,7 +5352,7 @@ static if (LOG_MATCHTYPE)
53815352
* See if we can resolve variables in e from values in ptal.
53825353
*/
53835354

5384-
/*private*/ elem *template_resolve_idents(elem *e, param_t *ptal)
5355+
private elem *template_resolve_idents(elem *e, param_t *ptal)
53855356
{
53865357
if (!OTleaf(e.Eoper))
53875358
{

dm/src/dmc/makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ OBJ1a=blklst.obj blockopt.obj dcpp.obj debug.obj ee.obj el.obj denum.obj err.obj
173173
OBJ1b=evalu8.obj eh.obj exp.obj exp2.obj file.obj filename.obj func.obj adl.obj
174174
OBJ1c=getcmd.obj ini.obj dinit.obj loadline.obj msc.obj precomp.obj
175175
OBJ1d=nspace.obj nwc.obj os.obj out.obj ph.obj ppexp.obj pragma.obj pseudo.obj
176-
OBJ1e=dstruct.obj symbol.obj dtemplate.obj template.obj tk.obj token.obj type.obj dt.obj dth.obj
176+
OBJ1e=dstruct.obj symbol.obj dtemplate.obj tk.obj token.obj type.obj dt.obj dth.obj
177177
OBJ1f=var.obj nteh.obj rtlsym.obj rtti.obj scope.obj tdbx.obj util.obj html.obj dlist.obj
178178
OBJ1g=unialpha.obj entity.obj aa.obj ti_achar.obj ti_pvoid.obj backconfig.obj dinline.obj oper.obj parser.obj dtoken.obj
179179

@@ -300,7 +300,7 @@ FRONTSRC= allocast.h cpp.h html.h parser.h scdll.h scope.h \
300300
\
301301
ini.c errmsgs2.c tdbx.c util.c \
302302
iasm.c err.c blklst.c \
303-
msgsx.c template.c scope.c \
303+
msgsx.c scope.c \
304304
trace.c file.c \
305305
exp2.c msc.c ph.c token.c \
306306
pragma.c nwc.c getcmd.c tk.c \
@@ -528,7 +528,6 @@ pdata.obj : $(DEP) $(pdata.dep) pdata.c
528528
pragma.obj : $(DEP) $(pragma.dep) pragma.c
529529
ptrntab.obj : $(DEP) $(ptrntab.dep) iasm.h ptrntab.c
530530
speller.obj : speller.h speller.c
531-
template.obj : $(DEP) $(template.dep) template.c
532531
ti_achar.obj : tinfo.h ti_achar.c
533532
ti_pvoid.obj : tinfo.h ti_pvoid.c
534533
tk.obj : $(DEP) $(tk.dep) tk.c

0 commit comments

Comments
 (0)