15 #ifndef LLVM_TRANSFORMS_UTILS_BUILDLIBCALLS_H 16 #define LLVM_TRANSFORMS_UTILS_BUILDLIBCALLS_H 24 class TargetLibraryInfo;
52 Value *
emitStrLen(Value *Ptr, IRBuilder<> &
B,
const DataLayout &DL,
53 const TargetLibraryInfo *TLI);
58 Value *
emitStrNLen(Value *Ptr, Value *MaxLen, IRBuilder<> &
B,
59 const DataLayout &DL,
const TargetLibraryInfo *TLI);
65 const TargetLibraryInfo *TLI);
68 Value *
emitStrNCmp(Value *Ptr1, Value *Ptr2, Value *Len, IRBuilder<> &
B,
69 const DataLayout &DL,
const TargetLibraryInfo *TLI);
73 Value *
emitStrCpy(Value *Dst, Value *Src, IRBuilder<> &
B,
74 const TargetLibraryInfo *TLI, StringRef
Name =
"strcpy");
78 Value *
emitStrNCpy(Value *Dst, Value *Src, Value *Len, IRBuilder<> &
B,
79 const TargetLibraryInfo *TLI, StringRef
Name =
"strncpy");
83 Value *
emitMemCpyChk(Value *Dst, Value *Src, Value *Len, Value *ObjSize,
84 IRBuilder<> &
B,
const DataLayout &DL,
85 const TargetLibraryInfo *TLI);
89 Value *
emitMemChr(Value *Ptr, Value *Val, Value *Len, IRBuilder<> &
B,
90 const DataLayout &DL,
const TargetLibraryInfo *TLI);
93 Value *
emitMemCmp(Value *Ptr1, Value *Ptr2, Value *Len, IRBuilder<> &
B,
94 const DataLayout &DL,
const TargetLibraryInfo *TLI);
101 const AttributeList &
Attrs);
107 LibFunc LongDoubleFn, IRBuilder<> &
B,
108 const AttributeList &
Attrs);
115 IRBuilder<> &
B,
const AttributeList &
Attrs);
118 Value *
emitPutChar(Value *Char, IRBuilder<> &
B,
const TargetLibraryInfo *TLI);
121 Value *
emitPutS(Value *Str, IRBuilder<> &
B,
const TargetLibraryInfo *TLI);
126 const TargetLibraryInfo *TLI);
131 const TargetLibraryInfo *TLI);
136 const TargetLibraryInfo *TLI);
141 const TargetLibraryInfo *TLI);
146 const DataLayout &DL,
const TargetLibraryInfo *TLI);
149 Value *
emitMalloc(Value *Num, IRBuilder<> &
B,
const DataLayout &DL,
150 const TargetLibraryInfo *TLI);
154 IRBuilder<> &
B,
const TargetLibraryInfo &TLI);
159 IRBuilder<> &
B,
const DataLayout &DL,
160 const TargetLibraryInfo *TLI);
164 const TargetLibraryInfo *TLI);
169 const TargetLibraryInfo *TLI);
174 IRBuilder<> &
B,
const DataLayout &DL,
175 const TargetLibraryInfo *TLI);
Type
MessagePack types as defined in the standard, with the exception of Integer being divided into a sign...
This class represents lattice values for constants.
Value * emitStrNCpy(Value *Dst, Value *Src, Value *Len, IRBuilder<> &B, const TargetLibraryInfo *TLI, StringRef Name="strncpy")
Emit a call to the strncpy function to the builder, for the specified pointer arguments and length...
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.
StringRef getUnaryFloatFn(const TargetLibraryInfo *TLI, Type *Ty, LibFunc DoubleFn, LibFunc FloatFn, LibFunc LongDoubleFn)
Get the name of the overloaded unary floating point function corresponding to Ty. ...
amdgpu Simplify well known AMD library false Value Value const Twine & Name
Value * emitPutChar(Value *Char, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the putchar function. This assumes that Char is an integer.
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 * emitStrCpy(Value *Dst, Value *Src, IRBuilder<> &B, const TargetLibraryInfo *TLI, StringRef Name="strcpy")
Emit a call to the strcpy function to the builder, for the specified pointer arguments.
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.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
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 * emitFGetCUnlocked(Value *File, IRBuilder<> &B, const TargetLibraryInfo *TLI)
Emit a call to the fgetc_unlocked function. File is a pointer to FILE.
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 * 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 * 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.
bool hasUnaryFloatFn(const TargetLibraryInfo *TLI, Type *Ty, LibFunc DoubleFn, LibFunc FloatFn, LibFunc LongDoubleFn)
Check whether the overloaded unary floating point function corresponding to Ty is available...