Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Add support for demangling __vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuclaw committed Aug 3, 2014
1 parent 2e881af commit a26bd03
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/core/demangle.d
Expand Up @@ -494,6 +494,7 @@ private struct Demangle
Immutable
Wild
TypeArray
TypeVector
TypeStaticArray
TypeAssocArray
TypePointer
Expand Down Expand Up @@ -544,6 +545,9 @@ private struct Demangle
TypeArray:
A Type
TypeVector:
Nh Type
TypeStaticArray:
G Number Type
Expand Down Expand Up @@ -713,6 +717,12 @@ private struct Demangle
parseType();
put( ")" );
return dst[beg .. len];
case 'h': // TypeVector (Nh Type)
next();
put( "__vector(" );
parseType();
put( ")" );
return dst[beg .. len];
default:
error();
assert( 0 );
Expand Down Expand Up @@ -912,9 +922,11 @@ private struct Demangle
put( "@safe " );
continue;
case 'g':
// NOTE: The inout parameter type is represented as "Ng",
// which makes it look like a FuncAttr. So if we
// see an "Ng" FuncAttr we know we're really in
case 'h':
// NOTE: The inout parameter type is represented as "Ng".
// The vector parameter type is represented as "Nh".
// These make it look like a FuncAttr, but infact
// if we see these, then we know we're really in
// the parameter list. Rewind and break.
pos--;
break breakFuncAttrs;
Expand Down Expand Up @@ -1797,6 +1809,13 @@ version(unittest)
["_D8serenity9persister6Sqlite70__T15SqlitePersisterTS8serenity9persister6Sqlite11__unittest6FZv4TestZ15SqlitePersister12__T7opIndexZ7opIndexMFmZS8serenity9persister6Sqlite11__unittest6FZv4Test",
"serenity.persister.Sqlite.__unittest6().Test serenity.persister.Sqlite.SqlitePersister!(serenity.persister.Sqlite.__unittest6().Test).SqlitePersister.opIndex!().opIndex(ulong)"],
["_D8bug100274mainFZv5localMFZi","int bug10027.main().local()"],
["_D8demangle4testFNhG16gZv", "void demangle.test(__vector(byte[16]))"],
["_D8demangle4testFNhG8sZv", "void demangle.test(__vector(short[8]))"],
["_D8demangle4testFNhG4iZv", "void demangle.test(__vector(int[4]))"],
["_D8demangle4testFNhG2lZv", "void demangle.test(__vector(long[2]))"],
["_D8demangle4testFNhG4fZv", "void demangle.test(__vector(float[4]))"],
["_D8demangle4testFNhG2dZv", "void demangle.test(__vector(double[2]))"],
["_D8demangle4testFNhG4fNhG4fZv", "void demangle.test(__vector(float[4]), __vector(float[4]))"],
];

template staticIota(int x)
Expand Down

0 comments on commit a26bd03

Please sign in to comment.