Mercurial > projects > ldc
comparison dmd/template.h @ 1147:dbe4af57b240
Changed use of toObjFile to a new codegen method.
More versioning of DMD specific codegen code.
author | Tomas Lindquist Olsen <tomas.l.olsen gmail.com> |
---|---|
date | Fri, 27 Mar 2009 17:54:27 +0100 |
parents | b30fe7e1dbb9 |
children | 0b26cfb2d445 |
comparison
equal
deleted
inserted
replaced
1146:1860414bf3b7 | 1147:dbe4af57b240 |
---|---|
89 | 89 |
90 TemplateDeclaration *isTemplateDeclaration() { return this; } | 90 TemplateDeclaration *isTemplateDeclaration() { return this; } |
91 | 91 |
92 TemplateTupleParameter *isVariadic(); | 92 TemplateTupleParameter *isVariadic(); |
93 int isOverloadable(); | 93 int isOverloadable(); |
94 | 94 |
95 #if IN_LLVM | |
95 // LDC | 96 // LDC |
96 std::string intrinsicName; | 97 std::string intrinsicName; |
98 #endif | |
97 }; | 99 }; |
98 | 100 |
99 struct TemplateParameter | 101 struct TemplateParameter |
100 { | 102 { |
101 /* For type-parameter: | 103 /* For type-parameter: |
308 const char *kind(); | 310 const char *kind(); |
309 int oneMember(Dsymbol **ps); | 311 int oneMember(Dsymbol **ps); |
310 char *toChars(); | 312 char *toChars(); |
311 char *mangle(); | 313 char *mangle(); |
312 | 314 |
315 #if IN_DMD | |
313 void toObjFile(int multiobj); // compile to .obj file | 316 void toObjFile(int multiobj); // compile to .obj file |
317 #endif | |
314 | 318 |
315 // Internal | 319 // Internal |
316 static void semanticTiargs(Loc loc, Scope *sc, Objects *tiargs); | 320 static void semanticTiargs(Loc loc, Scope *sc, Objects *tiargs); |
317 void semanticTiargs(Scope *sc); | 321 void semanticTiargs(Scope *sc); |
318 TemplateDeclaration *findTemplateDeclaration(Scope *sc); | 322 TemplateDeclaration *findTemplateDeclaration(Scope *sc); |
322 Identifier *genIdent(); | 326 Identifier *genIdent(); |
323 | 327 |
324 TemplateInstance *isTemplateInstance() { return this; } | 328 TemplateInstance *isTemplateInstance() { return this; } |
325 AliasDeclaration *isAliasDeclaration(); | 329 AliasDeclaration *isAliasDeclaration(); |
326 | 330 |
331 #if IN_LLVM | |
327 // LDC | 332 // LDC |
328 TemplateInstance *tinst; // enclosing template instance | 333 TemplateInstance *tinst; // enclosing template instance |
329 Module* tmodule; // module from outermost enclosing template instantiation | 334 Module* tmodule; // module from outermost enclosing template instantiation |
330 Module* emittedInModule; // which module this template instance has been emitted in | 335 Module* emittedInModule; // which module this template instance has been emitted in |
331 void printInstantiationTrace(); | 336 void printInstantiationTrace(); |
337 | |
338 void codegen(Ir*); | |
339 #endif | |
332 }; | 340 }; |
333 | 341 |
334 struct TemplateMixin : TemplateInstance | 342 struct TemplateMixin : TemplateInstance |
335 { | 343 { |
336 Array *idents; | 344 Array *idents; |
349 int hasPointers(); | 357 int hasPointers(); |
350 char *toChars(); | 358 char *toChars(); |
351 char *mangle(); | 359 char *mangle(); |
352 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | 360 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); |
353 | 361 |
362 #if IN_DMD | |
354 void toObjFile(int multiobj); // compile to .obj file | 363 void toObjFile(int multiobj); // compile to .obj file |
364 #endif | |
355 | 365 |
356 TemplateMixin *isTemplateMixin() { return this; } | 366 TemplateMixin *isTemplateMixin() { return this; } |
367 | |
368 #if IN_LLVM | |
369 void codegen(Ir*); | |
370 #endif | |
357 }; | 371 }; |
358 | 372 |
359 Expression *isExpression(Object *o); | 373 Expression *isExpression(Object *o); |
360 Dsymbol *isDsymbol(Object *o); | 374 Dsymbol *isDsymbol(Object *o); |
361 Type *isType(Object *o); | 375 Type *isType(Object *o); |