Go to the documentation of this file.
26 enum ManglerPrefixTy {
34 ManglerPrefixTy PrefixTy,
38 assert(!
Name.empty() &&
"getNameWithPrefix requires non-empty name");
42 if (
Name[0] ==
'\1') {
47 if (
DL.doNotMangleLeadingQuestionMark() &&
Name[0] ==
'?')
50 if (PrefixTy == Private)
51 OS <<
DL.getPrivateGlobalPrefix();
52 else if (PrefixTy == LinkerPrivate)
53 OS <<
DL.getLinkerPrivateGlobalPrefix();
64 ManglerPrefixTy PrefixTy) {
97 unsigned ArgWords = 0;
99 const unsigned PtrSize =
DL.getPointerSize();
104 if (A.hasStructRetAttr())
108 uint64_t AllocSize = A.hasPassPointeeByValueCopyAttr() ?
109 A.getPassPointeeByValueCopySize(
DL) :
110 DL.getTypeAllocSize(A.getType());
113 ArgWords +=
alignTo(AllocSize, PtrSize);
116 OS <<
'@' << ArgWords;
120 bool CannotUsePrivateLabel)
const {
121 ManglerPrefixTy PrefixTy = Default;
123 if (CannotUsePrivateLabel)
124 PrefixTy = LinkerPrivate;
133 unsigned &
ID = AnonGlobalIDs[GV];
135 ID = AnonGlobalIDs.size();
151 if (
Name.startswith(
"\01") ||
152 (
DL.doNotMangleLeadingQuestionMark() &&
Name.startswith(
"?")))
157 if (!
DL.hasMicrosoftFastStdCallMangling() &&
187 bool CannotUsePrivateLabel)
const {
194 return isAlnum(
C) ||
C ==
'_' ||
C ==
'@';
203 for (
char C :
Name) {
216 if (TT.isWindowsMSVCEnvironment())
224 if (TT.isWindowsGNUEnvironment() || TT.isWindowsCygwinEnvironment()) {
230 OS <<
Flag.substr(1);
240 if (TT.isWindowsMSVCEnvironment())
249 if (!
T.isWindowsMSVCEnvironment())
256 M.getNameWithPrefix(OS, GV,
false);
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
This class represents an incoming formal argument to a Function.
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
A parsed version of the target data layout string in and methods for querying it.
A raw_ostream that writes to an std::string.
Triple - Helper class for working with autoconf configuration names.
unsigned getNumParams() const
Return the number of fixed parameters this function type requires.
bool isDeclaration() const
Return true if the primary definition of this global value is outside of the current translation unit...
static bool hasByteCountSuffix(CallingConv::ID CC)
(vector float) vec_cmpeq(*A, *B) C
static bool canBeUnquotedInDirective(char C)
bool hasPrivateLinkage() const
void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, bool CannotUsePrivateLabel) const
Print the appropriate prefix and the specified global variable's name.
Flag
These should be considered private to the implementation of the MCInstrDesc class.
This class implements an extremely fast bulk output stream that can only output to a stream.
bool isFunctionTy() const
True if this is an instance of FunctionType.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
Module * getParent()
Get the module that this global value is contained inside of...
bool hasStructRetAttr() const
Determine if the function returns a structure through first or second pointer argument.
char getGlobalPrefix() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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...
@ C
C - The default llvm calling convention, compatible with C.
StringRef - Represent a constant reference to a string, i.e.
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
void emitLinkerFlagsForUsedCOFF(raw_ostream &OS, const GlobalValue *GV, const Triple &T, Mangler &M)
const GlobalObject * getAliaseeObject() const
StringRef getName() const
Return a constant reference to the value's name.
static void getNameWithPrefixImpl(raw_ostream &OS, const Twine &GVName, ManglerPrefixTy PrefixTy, const DataLayout &DL, char Prefix)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
bool hasDLLExportStorageClass() const
@ X86_StdCall
X86_StdCall - stdcall is the calling conventions mostly used by the Win32 API.
FunctionType * getFunctionType() const
Returns the FunctionType for me.
void emitLinkerFlagsForGlobalCOFF(raw_ostream &OS, const GlobalValue *GV, const Triple &TT, Mangler &Mangler)
A raw_ostream that writes to an SmallVector or SmallString.
@ X86_FastCall
X86_FastCall - 'fast' analog of X86_StdCall.
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
Type * getValueType() const
StringRef toStringRef(SmallVectorImpl< char > &Out) const
This returns the twine as a single StringRef if it can be represented as such.
@ X86_VectorCall
MSVC calling convention that passes vectors and vector aggregates in SSE registers.
Class to represent function types.