Mercurial > projects > ldc
comparison dmd/mangle.c @ 321:571959608194 trunk
[svn r342] Fix DMD bug 2206.
Implement mixin declarations in LLVMDC.
author | ChristianK |
---|---|
date | Wed, 09 Jul 2008 17:01:08 +0200 |
parents | 2b72433d5c8c |
children | 55f6c2e454d7 |
comparison
equal
deleted
inserted
replaced
320:d772927ca496 | 321:571959608194 |
---|---|
219 //printf("TemplateInstance::mangle() %s = %s\n", toChars(), id); | 219 //printf("TemplateInstance::mangle() %s = %s\n", toChars(), id); |
220 return id; | 220 return id; |
221 } | 221 } |
222 | 222 |
223 | 223 |
224 | 224 char *TemplateMixin::mangle() |
225 char *Dsymbol::mangle() | |
226 { | 225 { |
227 OutBuffer buf; | 226 OutBuffer buf; |
228 char *id; | 227 char *id; |
229 | 228 |
230 #if 0 | 229 #if 0 |
231 printf("Dsymbol::mangle() '%s'", toChars()); | 230 printf("TemplateMixin::mangle() %s", toChars()); |
232 if (parent) | 231 if (parent) |
233 printf(" parent = %s %s", parent->kind(), parent->toChars()); | 232 printf(" parent = %s %s", parent->kind(), parent->toChars()); |
234 printf("\n"); | 233 printf("\n"); |
235 #endif | 234 #endif |
236 id = ident ? ident->toChars() : toChars(); | 235 id = ident ? ident->toChars() : toChars(); |
237 if (parent) | 236 if (parent) |
238 { | 237 { |
242 buf.writestring(p); | 241 buf.writestring(p); |
243 } | 242 } |
244 buf.printf("%"PRIuSIZE"%s", strlen(id), id); | 243 buf.printf("%"PRIuSIZE"%s", strlen(id), id); |
245 id = buf.toChars(); | 244 id = buf.toChars(); |
246 buf.data = NULL; | 245 buf.data = NULL; |
246 //printf("TemplateMixin::mangle() %s = %s\n", toChars(), id); | |
247 return id; | |
248 } | |
249 | |
250 char *Dsymbol::mangle() | |
251 { | |
252 OutBuffer buf; | |
253 char *id; | |
254 | |
255 #if 0 | |
256 printf("Dsymbol::mangle() '%s'", toChars()); | |
257 if (parent) | |
258 printf(" parent = %s %s", parent->kind(), parent->toChars()); | |
259 printf("\n"); | |
260 #endif | |
261 id = ident ? ident->toChars() : toChars(); | |
262 if (parent) | |
263 { | |
264 char *p = parent->mangle(); | |
265 if (p[0] == '_' && p[1] == 'D') | |
266 p += 2; | |
267 buf.writestring(p); | |
268 } | |
269 buf.printf("%"PRIuSIZE"%s", strlen(id), id); | |
270 id = buf.toChars(); | |
271 buf.data = NULL; | |
247 //printf("Dsymbol::mangle() %s = %s\n", toChars(), id); | 272 //printf("Dsymbol::mangle() %s = %s\n", toChars(), id); |
248 return id; | 273 return id; |
249 } | 274 } |
250 | 275 |
251 | 276 |