9#ifndef LLVM_SUPPORT_TYPENAME_H
10#define LLVM_SUPPORT_TYPENAME_H
18#if defined(__clang__) || defined(__GNUC__)
23 assert(!
Name.empty() &&
"Unable to find the template parameter!");
26 assert(
Name.ends_with(
"]") &&
"Name doesn't end in the substitution key!");
27 return Name.drop_back(1);
28#elif defined(_MSC_VER)
33 assert(!
Name.empty() &&
"Unable to find the function name!");
36 for (
StringRef Prefix : {
"class ",
"struct ",
"union ",
"enum "})
37 if (
Name.starts_with(Prefix)) {
38 Name =
Name.drop_front(Prefix.size());
42 auto AnglePos =
Name.rfind(
'>');
44 return Name.substr(0, AnglePos);
48 return "UNKNOWN_TYPE";
64 static StringRef Name = detail::getTypeNameImpl<DesiredTypeName>();
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringRef - Represent a constant reference to a string, i.e.
static constexpr size_t npos
StringRef getTypeNameImpl()
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.