diff options
Diffstat (limited to 'gcc/d/dmd/cppmangle.c')
-rw-r--r-- | gcc/d/dmd/cppmangle.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/d/dmd/cppmangle.c b/gcc/d/dmd/cppmangle.c index b361d37..3f571fc 100644 --- a/gcc/d/dmd/cppmangle.c +++ b/gcc/d/dmd/cppmangle.c @@ -582,13 +582,21 @@ class CppMangleVisitor : public Visitor //printf("mangle_function(%s)\n", d->toChars()); /* * <mangled-name> ::= _Z <encoding> + */ + buf->writestring("_Z"); + this->mangle_function_encoding(d); + } + + void mangle_function_encoding(FuncDeclaration *d) + { + //printf("mangle_function_encoding(%s)\n", d->toChars()); + /* * <encoding> ::= <function name> <bare-function-type> * ::= <data name> * ::= <special-name> */ TypeFunction *tf = (TypeFunction *)d->type; - buf->writestring("_Z"); if (getFuncTemplateDecl(d)) { /* It's an instance of a function template @@ -1132,3 +1140,13 @@ const char *cppTypeInfoMangleItanium(Dsymbol *s) v.cpp_mangle_name(s, false); return buf.extractChars(); } + +const char *cppThunkMangleItanium(FuncDeclaration *fd, int offset) +{ + //printf("cppThunkMangleItanium(%s)\n", fd.toChars()); + OutBuffer buf; + buf.printf("_ZThn%u_", offset); // "Th" means thunk, "n%u" is the call offset + CppMangleVisitor v(&buf, fd->loc); + v.mangle_function_encoding(fd); + return buf.extractChars(); +} |