comparison dmd/mangle.c @ 1367:8026319762be

Merged DMD 1.045 !!!
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Sat, 16 May 2009 22:21:31 +0200
parents e961851fb8be
children def7a1d494fd
comparison
equal deleted inserted replaced
1366:81121ac19f61 1367:8026319762be
1 1
2 // Compiler implementation of the D programming language 2 // Compiler implementation of the D programming language
3 // Copyright (c) 1999-2007 by Digital Mars 3 // Copyright (c) 1999-2009 by Digital Mars
4 // All Rights Reserved 4 // All Rights Reserved
5 // written by Walter Bright 5 // written by Walter Bright
6 // http://www.digitalmars.com 6 // http://www.digitalmars.com
7 // License for redistribution is by either the Artistic License 7 // License for redistribution is by either the Artistic License
8 // in artistic.txt, or the GNU General Public License in gnu.txt. 8 // in artistic.txt, or the GNU General Public License in gnu.txt.
22 #include "attrib.h" 22 #include "attrib.h"
23 #include "template.h" 23 #include "template.h"
24 #include "id.h" 24 #include "id.h"
25 #include "module.h" 25 #include "module.h"
26 26
27 #if TARGET_LINUX || TARGET_OSX 27 #if TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_SOLARIS
28 char *cpp_mangle(Dsymbol *s); 28 char *cpp_mangle(Dsymbol *s);
29 #endif 29 #endif
30 30
31 char *mangle(Declaration *sthis) 31 char *mangle(Declaration *sthis)
32 { 32 {
115 case LINKwindows: 115 case LINKwindows:
116 case LINKpascal: 116 case LINKpascal:
117 return ident->toChars(); 117 return ident->toChars();
118 118
119 case LINKcpp: 119 case LINKcpp:
120 #if DMDV2 && (TARGET_LINUX || TARGET_OSX) 120 #if DMDV2 && (TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_SOLARIS)
121 return cpp_mangle(this); 121 return cpp_mangle(this);
122 #else 122 #else
123 // Windows C++ mangling is done by C++ back end 123 // Windows C++ mangling is done by C++ back end
124 return ident->toChars(); 124 return ident->toChars();
125 #endif 125 #endif
218 if (parent) 218 if (parent)
219 printf(" parent = %s %s", parent->kind(), parent->toChars()); 219 printf(" parent = %s %s", parent->kind(), parent->toChars());
220 printf("\n"); 220 printf("\n");
221 #endif 221 #endif
222 id = ident ? ident->toChars() : toChars(); 222 id = ident ? ident->toChars() : toChars();
223 if (tempdecl->parent) 223 if (!tempdecl)
224 error("is not defined");
225 else if (tempdecl->parent)
224 { 226 {
225 char *p = tempdecl->parent->mangle(); 227 char *p = tempdecl->parent->mangle();
226 if (p[0] == '_' && p[1] == 'D') 228 if (p[0] == '_' && p[1] == 'D')
227 p += 2; 229 p += 2;
228 buf.writestring(p); 230 buf.writestring(p);