We provide a function which tries to compute the (demangled) name of a type statically.

Synopsis

Declared in <llvm/Support/TypeName.h>

template<typename DesiredTypeName>
constexpr
StringRef
getTypeName();

Description

This routine may fail on some platforms or for particularly unusual types. Do not use it for anything other than logging and debugging aids. It isn't portable or dependendable in any real sense.

The returned StringRef will point into a static storage duration string. However, it may not be null terminated and may be some strangely aligned inner substring of a larger string.

Return Value

A StringRef naming the type, pointing into static storage.

Created with MrDocs