36                                  ManglerPrefixTy PrefixTy,
 
   40  assert(!Name.empty() && 
"getNameWithPrefix requires non-empty name");
 
   44  if (Name[0] == 
'\1') {
 
   49  if (
DL.doNotMangleLeadingQuestionMark() && Name[0] == 
'?')
 
   52  if (PrefixTy == Private)
 
   53    OS << 
DL.getPrivateGlobalPrefix();
 
   54  else if (PrefixTy == LinkerPrivate)
 
   55    OS << 
DL.getLinkerPrivateGlobalPrefix();
 
 
   66                                  ManglerPrefixTy PrefixTy) {
 
   67  char Prefix = 
DL.getGlobalPrefix();
 
 
   79  char Prefix = 
DL.getGlobalPrefix();
 
 
   99  unsigned ArgWords = 0;
 
  101  const unsigned PtrSize = 
DL.getPointerSize();
 
  106    if (
A.hasStructRetAttr())
 
  110    uint64_t AllocSize = 
A.hasPassPointeeByValueCopyAttr() ?
 
  111      A.getPassPointeeByValueCopySize(
DL) :
 
  112      DL.getTypeAllocSize(
A.getType());
 
  115    ArgWords += 
alignTo(AllocSize, PtrSize);
 
  118  OS << 
'@' << ArgWords;
 
 
  122                                bool CannotUsePrivateLabel)
 const {
 
  123  ManglerPrefixTy PrefixTy = 
Default;
 
  124  assert(GV != 
nullptr && 
"Invalid Global Value");
 
  126    if (CannotUsePrivateLabel)
 
  127      PrefixTy = LinkerPrivate;
 
  136    unsigned &
ID = AnonGlobalIDs[GV];
 
  138      ID = AnonGlobalIDs.size();
 
  146  char Prefix = 
DL.getGlobalPrefix();
 
  154  if (Name.starts_with(
"\01") ||
 
  155      (
DL.doNotMangleLeadingQuestionMark() && Name.starts_with(
"?")))
 
  160  if (!
DL.hasMicrosoftFastStdCallMangling() &&
 
 
  190                                bool CannotUsePrivateLabel)
 const {
 
 
  197  return isAlnum(
C) || 
C == 
'_' || 
C == 
'@' || 
C == 
'#';
 
 
  206  for (
char C : Name) {
 
 
  218    if (TT.isWindowsMSVCEnvironment() || TT.isUEFI())
 
  226    if (TT.isWindowsGNUEnvironment() || TT.isWindowsCygwinEnvironment()) {
 
  232        OS << Flag.substr(1);
 
  238    if (TT.isWindowsArm64EC()) {
 
  244      if (std::optional<std::string> demangledName =
 
  246        OS << 
",EXPORTAS," << *demangledName;
 
  252      if (TT.isWindowsMSVCEnvironment() || TT.isUEFI())
 
  260    OS << 
" -exclude-symbols:";
 
  271      OS << Flag.substr(1);
 
 
  282  if (!
T.isWindowsMSVCEnvironment())
 
  289  M.getNameWithPrefix(OS, GV, 
false);
 
 
  296         "getArm64ECMangledFunctionName requires non-empty name");
 
  298  if (Name[0] != 
'?') {
 
  303    return std::optional<std::string>((
"#" + Name).str());
 
  307  if (Name.contains(
"$$h"))
 
  320  if (Name.starts_with(
"??@") && Name.ends_with(
"@"))
 
  321    return (Name + 
"$$h@").str();
 
  328  return std::optional<std::string>(
 
  329      (Name.substr(0, *InsertIdx) + 
"$$h" + Name.substr(*InsertIdx)).str());
 
 
  332std::optional<std::string>
 
  336    return std::optional<std::string>(Name.substr(1));
 
  341  if (Name.starts_with(
"??@") && Name.ends_with(
"@$$h@"))
 
  342    return Name.drop_back(4).str();
 
  345  std::pair<StringRef, StringRef> Pair = Name.split(
"$$h");
 
  346  if (Pair.second.empty())
 
  348  return std::optional<std::string>((Pair.first + Pair.second).str());
 
 
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
 
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
 
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
 
Module.h This file contains the declarations for the Module class.
 
static bool canBeUnquotedInDirective(char C)
 
static void getNameWithPrefixImpl(raw_ostream &OS, const Twine &GVName, ManglerPrefixTy PrefixTy, const DataLayout &DL, char Prefix)
 
static void addByteCountSuffix(raw_ostream &OS, const Function *F, const DataLayout &DL)
Microsoft fastcall and stdcall functions require a suffix on their name indicating the number of word...
 
static bool hasByteCountSuffix(CallingConv::ID CC)
 
This file defines the SmallString class.
 
This class represents an incoming formal argument to a Function.
 
A parsed version of the target data layout string in and methods for querying it.
 
char getGlobalPrefix() const
 
Class to represent function types.
 
unsigned getNumParams() const
Return the number of fixed parameters this function type requires.
 
FunctionType * getFunctionType() const
Returns the FunctionType for me.
 
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
 
bool hasStructRetAttr() const
Determine if the function returns a structure through first or second pointer argument.
 
LLVM_ABI bool isDeclaration() const
Return true if the primary definition of this global value is outside of the current translation unit...
 
bool hasPrivateLinkage() const
 
bool hasHiddenVisibility() const
 
bool hasDLLExportStorageClass() const
 
LLVM_ABI const GlobalObject * getAliaseeObject() const
 
LLVM_ABI const DataLayout & getDataLayout() const
Get the data layout of the module this global belongs to.
 
Type * getValueType() const
 
LLVM_ABI void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, bool CannotUsePrivateLabel) const
Print the appropriate prefix and the specified global variable's name.
 
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
 
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
 
StringRef - Represent a constant reference to a string, i.e.
 
Triple - Helper class for working with autoconf configuration names.
 
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
 
StringRef toStringRef(SmallVectorImpl< char > &Out) const
This returns the twine as a single StringRef if it can be represented as such.
 
bool isFunctionTy() const
True if this is an instance of FunctionType.
 
LLVM_ABI StringRef getName() const
Return a constant reference to the value's name.
 
This class implements an extremely fast bulk output stream that can only output to a stream.
 
A raw_ostream that writes to an std::string.
 
A raw_ostream that writes to an SmallVector or SmallString.
 
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
 
@ X86_StdCall
stdcall is mostly used by the Win32 API.
 
@ X86_VectorCall
MSVC calling convention that passes vectors and vector aggregates in SSE registers.
 
@ C
The default llvm calling convention, compatible with C.
 
@ X86_FastCall
'fast' analog of X86_StdCall.
 
This is an optimization pass for GlobalISel generic memory operations.
 
LLVM_ABI std::optional< std::string > getArm64ECMangledFunctionName(StringRef Name)
Returns the ARM64EC mangled function name unless the input is already mangled.
 
LLVM_ABI std::optional< std::string > getArm64ECDemangledFunctionName(StringRef Name)
Returns the ARM64EC demangled function name, unless the input is not mangled.
 
DEMANGLE_ABI std::optional< size_t > getArm64ECInsertionPointInMangledName(std::string_view MangledName)
 
auto dyn_cast_or_null(const Y &Val)
 
bool isAlnum(char C)
Checks whether character C is either a decimal digit or an uppercase or lowercase letter as classifie...
 
LLVM_ABI void emitLinkerFlagsForUsedCOFF(raw_ostream &OS, const GlobalValue *GV, const Triple &T, Mangler &M)
 
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
 
LLVM_ABI void emitLinkerFlagsForGlobalCOFF(raw_ostream &OS, const GlobalValue *GV, const Triple &TT, Mangler &Mangler)
 
@ Default
The result values are uniform if and only if all operands are uniform.