9#ifndef LLVM_SUPPORT_TYPENAME_H
10#define LLVM_SUPPORT_TYPENAME_H
26template <
typename DesiredTypeName>
28#if defined(__clang__) || defined(__GNUC__)
33 assert(!
Name.empty() &&
"Unable to find the template parameter!");
36 assert(
Name.ends_with(
"]") &&
"Name doesn't end in the substitution key!");
37 return Name.drop_back(1);
38#elif defined(_MSC_VER)
43 assert(!
Name.empty() &&
"Unable to find the function name!");
46 for (
StringRef Prefix : {
"class ",
"struct ",
"union ",
"enum "})
47 if (
Name.starts_with(Prefix)) {
48 Name =
Name.drop_front(Prefix.size());
52 auto AnglePos =
Name.rfind(
'>');
54 return Name.substr(0, AnglePos);
58 return "UNKNOWN_TYPE";
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringRef - Represent a constant reference to a string, i.e.
static constexpr size_t npos
This is an optimization pass for GlobalISel generic memory operations.
StringRef getTypeName()
We provide a function which tries to compute the (demangled) name of a type statically.