14 #ifndef LLVM_TRANSFORMS_UTILS_BUILDLIBCALLS_H 15 #define LLVM_TRANSFORMS_UTILS_BUILDLIBCALLS_H 23 class TargetLibraryInfo;
51 const TargetLibraryInfo *TLI);
62 const DataLayout &DL,
const TargetLibraryInfo *TLI);
68 const TargetLibraryInfo *TLI);
72 const DataLayout &DL,
const TargetLibraryInfo *TLI);
77 const TargetLibraryInfo *TLI);
82 const TargetLibraryInfo *TLI);
87 const TargetLibraryInfo *TLI);
92 const TargetLibraryInfo *TLI);
98 const TargetLibraryInfo *TLI);
103 const DataLayout &DL,
const TargetLibraryInfo *TLI);
107 const DataLayout &DL,
const TargetLibraryInfo *TLI);
111 const DataLayout &DL,
const TargetLibraryInfo *TLI);
120 const TargetLibraryInfo *TLI);
128 const TargetLibraryInfo *TLI);
132 const TargetLibraryInfo *TLI);
136 const TargetLibraryInfo *TLI);
140 const TargetLibraryInfo *TLI);
148 const TargetLibraryInfo *TLI);
155 const AttributeList &
Attrs);
162 const AttributeList &
Attrs);
174 const TargetLibraryInfo *TLI,
LibFunc DoubleFn,
187 const TargetLibraryInfo *TLI);
192 const TargetLibraryInfo *TLI);
197 const TargetLibraryInfo *TLI);
202 const TargetLibraryInfo *TLI);
207 const DataLayout &DL,
const TargetLibraryInfo *TLI);
211 const TargetLibraryInfo *TLI);
221 const TargetLibraryInfo *TLI);
225 const TargetLibraryInfo *TLI);
230 const TargetLibraryInfo *TLI);
236 const TargetLibraryInfo *TLI);
Value * emitStpCpy(Value *Dst, Value *Src, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the stpcpy function to the builder, for the specified pointer arguments.
This class represents lattice values for constants.
Value * emitStrDup(Value *Ptr, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the strdup function to the builder, for the specified pointer.
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
Value * emitSNPrintf(Value *Dest, Value *Size, Value *Fmt, ArrayRef< Value *> Args, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the snprintf function.
Value * emitMemCCpy(Value *Ptr1, Value *Ptr2, Value *Val, Value *Len, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the memccpy function.
Value * emitFPutSUnlocked(Value *Str, Value *File, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the fputs_unlocked function.
Value * emitMalloc(Value *Num, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI)
Emit a call to the malloc function.
Value * emitPutChar(Value *Char, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the putchar function. This assumes that Char is an integer.
Value * emitStrLCpy(Value *Dest, Value *Src, Value *Size, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the strlcpy function.
Value * emitUnaryFloatFnCall(Value *Op, StringRef Name, IRBuilder<> &B, const AttributeList &Attrs)
Emit a call to the unary function named 'Name' (e.g.
Value * emitFPutCUnlocked(Value *Char, Value *File, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the fputc_unlocked function.
Value * emitMemCpyChk(Value *Dst, Value *Src, Value *Len, Value *ObjSize, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI)
Emit a call to the __memcpy_chk function to the builder.
Value * emitVSPrintf(Value *Dest, Value *Fmt, Value *VAList, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the vsprintf function.
constexpr char Attrs[]
Key for Kernel::Metadata::mAttrs.
Value * emitFPutS(Value *Str, Value *File, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the fputs function.
bool inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI)
Analyze the name and prototype of the given function and set any applicable attributes.
StringRef getFloatFnName(const TargetLibraryInfo *TLI, Type *Ty, LibFunc DoubleFn, LibFunc FloatFn, LibFunc LongDoubleFn)
Get the name of the overloaded floating point function corresponding to Ty.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Instrumentation for Order File
Value * castToCStr(Value *V, IRBuilder<> &B)
Return V if it is an i8*, otherwise cast it to i8*.
Value * emitStrChr(Value *Ptr, char C, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the strchr function to the builder, for the specified pointer and character.
Value * emitFWriteUnlocked(Value *Ptr, Value *Size, Value *N, Value *File, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI)
Emit a call to the fwrite_unlocked function.
Value * emitStrLen(Value *Ptr, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI)
Emit a call to the strlen function to the builder, for the specified pointer.
Value * emitBinaryFloatFnCall(Value *Op1, Value *Op2, StringRef Name, IRBuilder<> &B, const AttributeList &Attrs)
Emit a call to the binary function named 'Name' (e.g.
Value * emitStrNCpy(Value *Dst, Value *Src, Value *Len, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the strncpy function to the builder, for the specified pointer arguments and length...
Value * emitFGetCUnlocked(Value *File, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the fgetc_unlocked function. File is a pointer to FILE.
Value * emitStrCat(Value *Dest, Value *Src, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the strcat function.
Value * emitStrCpy(Value *Dst, Value *Src, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the strcpy function to the builder, for the specified pointer arguments.
Value * emitVSNPrintf(Value *Dest, Value *Size, Value *Fmt, Value *VAList, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the vsnprintf function.
Value * emitFPutC(Value *Char, Value *File, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the fputc function.
Value * emitFGetSUnlocked(Value *Str, Value *Size, Value *File, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the fgets_unlocked function.
Value * emitStrNCmp(Value *Ptr1, Value *Ptr2, Value *Len, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI)
Emit a call to the strncmp function to the builder.
Value * emitStrNLen(Value *Ptr, Value *MaxLen, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI)
Emit a call to the strnlen function to the builder, for the specified pointer.
Value * emitStrLCat(Value *Dest, Value *Src, Value *Size, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the strlcat function.
Value * emitBCmp(Value *Ptr1, Value *Ptr2, Value *Len, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI)
Emit a call to the bcmp function.
Value * emitSPrintf(Value *Dest, Value *Fmt, ArrayRef< Value *> VariadicArgs, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the sprintf function.
Value * emitFWrite(Value *Ptr, Value *Size, Value *File, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI)
Emit a call to the fwrite function.
Value * emitMemCmp(Value *Ptr1, Value *Ptr2, Value *Len, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI)
Emit a call to the memcmp function.
Value * emitFReadUnlocked(Value *Ptr, Value *Size, Value *N, Value *File, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI)
Emit a call to the fread_unlocked function.
Value * emitPutS(Value *Str, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the puts function. This assumes that Str is some pointer.
Value * emitStpNCpy(Value *Dst, Value *Src, Value *Len, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the stpncpy function to the builder, for the specified pointer arguments and length...
Value * emitMemChr(Value *Ptr, Value *Val, Value *Len, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI)
Emit a call to the memchr function.
Value * emitCalloc(Value *Num, Value *Size, const AttributeList &Attrs, IRBuilder<> &B, const TargetLibraryInfo &TLI)
Emit a call to the calloc function.
Value * emitStrNCat(Value *Dest, Value *Src, Value *Size, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the strncat function.
bool hasFloatFn(const TargetLibraryInfo *TLI, Type *Ty, LibFunc DoubleFn, LibFunc FloatFn, LibFunc LongDoubleFn)
Check whether the overloaded floating point function corresponding to Ty is available.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.