13#ifndef LLVM_EXECUTIONENGINE_ORC_SHARED_MANGLER_H
14#define LLVM_EXECUTIONENGINE_ORC_SHARED_MANGLER_H
41 : MM(fromTriple(TT, ABIName)) {}
47 template <
typename HandlerFn>
57 if (NameSpec.
getName()[0] ==
'\1')
60 if (NameSpec.
getName()[0] ==
'?' && doNotMangleLeadingQuestionMark())
77 [](
StringRef MangledName) {
return MangledName.
str(); }, Name);
86 if (!
Spec.starts_with(
"m:"))
88 auto ModeStr =
Spec.drop_front(2);
89 assert(ModeStr.size() == 1 &&
90 "invalid data layout string from Triple::computeDataLayout");
108 "Invalid mangling mode from Triple::computeDataLayout");
116 static Mode fromTriple(
const Triple &TT, StringRef ABIName) {
117 return fromDataLayoutStr(
TT.computeDataLayout(ABIName));
120 bool doNotMangleLeadingQuestionMark()
const {
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static cl::opt< RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Development, "development", "for training")))
This file defines the SmallString class.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
void append(StringRef RHS)
Append from a StringRef.
Represent a constant reference to a string, i.e.
std::string str() const
Get the contents as an std::string.
constexpr StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
constexpr bool empty() const
Check if the string is empty.
Triple - Helper class for working with autoconf configuration names.
Mode
The linker name-mangling scheme for a target, determined by its object format.
Mangler(const Triple &TT, StringRef ABIName="")
decltype(auto) withMangledNameDo(HandlerFn &&H, const SymbolNameSpec &NameSpec) const
Calls the given callback with the mangled version of NameSpec as a StringRef.
std::string mangledCopy(const SymbolNameSpec &Name) const
Construct a mangled version of the given name as a std::string.
A symbol name together with the naming level (SymbolNameKind) it is expressed in, so that a Mangler /...
constexpr StringRef getName() const
constexpr SymbolNameKind getKind() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
iterator_range< SplittingIterator > split(StringRef Str, StringRef Separator)
Split the specified string over a separator and return a range-compatible iterable over its partition...