HomePhabricator

First attempt at __unique_stable_name

Authored by erichkeane on Jun 24 2019, 8:03 AM.

Description

First attempt at __unique_stable_name

This implementation uses the keyword __unique_stable_name as an operator
that can take a type or expression, and will result in a constexpr
constant character array that (hopefully) uniquely represents the type
or type-of-expression being passed to it.

The unique representation is the normal mangled name of the type, except
in the cases of a lambda, where the ordinal "number" is just replaced
with LINE->COL. Macro expansions are also appended with '~' followed by
the LINE->COL that it appears in.

For example, a lambda declared in
'main' would look like _ZTSZ4mainEUlvE25->12 (line 25, column 12).

A Lambda that comes from a macro looks like:
_ZTSZ4mainEUlvE45->3~18->32 (macro invoked on 45/3, lambda defined
inside the macro on line 18, column 32).

Template instantiations based on the lambda would result in a name that
contains the lambda mangling, for example:
_ZTSZ3bazIZ4mainEUlvE25->12EvvEUlvE14->12

A function template named 'baz' that is instantiated with a lambda
declared in 'main' on line 25/col 12 has another macro in it, declared
on line 14, column 12.

WIP

Signed-off-by: Erich Keane <erich.keane@intel.com>

Details

Committed
erichkeaneJun 24 2019, 11:25 AM
Parents
rG439073351855: [SYCL] Fix cl::sycl::group get_linear_id API name.
Branches
Unknown
Tags
Unknown
References
refs/pull/16/head