[cxx-abi-dev] mangling of vendor extension, expression on function (not function type)

Nick Lewycky nlewycky at google.com
Tue Jan 21 02:13:16 UTC 2014


Hi,

I'm trying to mangle a vendor extension that encodes an expression which
applies to function overload candidates, with the goal that a user running
the demangler would see their expression demangled. While there are various
vendor extension points, none of them allow me to go into encoding an
expression, unless I stick a stray "decltype" in there, or similar
(expression in a template argument that doesn't actually exist, etc.).

The vendor extension is described in full here:
http://clang.llvm.org/docs/LanguageExtensions.html#controlling-overload-resolution.

I don't think I can do it without an extension to the mangling rules. As a
strawman proposal, I suggest this:

<type> ::= Ue <expression> E # vendor extended type qualifier

This shouldn't be ambiguous to decode because the first byte of a
<source-name> can't be an 'e', it has to be a <positive length number>, and
there aren't other rules for manglings starting with 'U' in the position
where a <type> can go. It will bust today's demanglers, but only for users
of my new extension and we already have that problem.

This has the slight bug that it gets placed as part of the <function-type>
when it isn't actually part of the type of the function at the language
level, but as far as I can tell it behaves exactly how I want.

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/cxx-abi-dev/attachments/20140120/9ba44821/attachment.html>


More information about the cxx-abi-dev mailing list