15 #ifndef LLVM_TRANSFORMS_UTILS_BUILDLIBCALLS_H
16 #define LLVM_TRANSFORMS_UTILS_BUILDLIBCALLS_H
23 class TargetLibraryInfo;
31 Value *
EmitStrLen(Value *Ptr, IRBuilder<> &B,
const DataLayout &DL,
32 const TargetLibraryInfo *TLI);
37 Value *
EmitStrNLen(Value *Ptr, Value *MaxLen, IRBuilder<> &B,
38 const DataLayout &DL,
const TargetLibraryInfo *TLI);
43 Value *
EmitStrChr(Value *Ptr,
char C, IRBuilder<> &B,
44 const TargetLibraryInfo *TLI);
47 Value *
EmitStrNCmp(Value *Ptr1, Value *Ptr2, Value *Len, IRBuilder<> &B,
48 const DataLayout &DL,
const TargetLibraryInfo *TLI);
52 Value *
EmitStrCpy(Value *Dst, Value *Src, IRBuilder<> &B,
53 const TargetLibraryInfo *TLI, StringRef
Name =
"strcpy");
57 Value *
EmitStrNCpy(Value *Dst, Value *Src, Value *Len, IRBuilder<> &B,
58 const TargetLibraryInfo *TLI, StringRef
Name =
"strncpy");
63 Value *
EmitMemCpyChk(Value *Dst, Value *Src, Value *Len, Value *ObjSize,
64 IRBuilder<> &B,
const DataLayout &DL,
65 const TargetLibraryInfo *TLI);
69 Value *
EmitMemChr(Value *Ptr, Value *Val, Value *Len, IRBuilder<> &B,
70 const DataLayout &DL,
const TargetLibraryInfo *TLI);
73 Value *
EmitMemCmp(Value *Ptr1, Value *Ptr2, Value *Len, IRBuilder<> &B,
74 const DataLayout &DL,
const TargetLibraryInfo *TLI);
82 const AttributeSet &Attrs);
90 IRBuilder<> &B,
const AttributeSet &Attrs);
94 Value *
EmitPutChar(Value *Char, IRBuilder<> &B,
const TargetLibraryInfo *TLI);
98 Value *
EmitPutS(Value *Str, IRBuilder<> &B,
const TargetLibraryInfo *TLI);
103 const TargetLibraryInfo *TLI);
108 const TargetLibraryInfo *TLI);
112 Value *
EmitFWrite(Value *Ptr, Value *Size, Value *
File, IRBuilder<> &B,
113 const DataLayout &DL,
const TargetLibraryInfo *TLI);
Value * EmitPutChar(Value *Char, IRBuilder<> &B, const TargetLibraryInfo *TLI)
EmitPutChar - Emit a call to the putchar function.
Value * EmitStrLen(Value *Ptr, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI)
EmitStrLen - Emit a call to the strlen function to the builder, for the specified pointer...
Value * EmitFWrite(Value *Ptr, Value *Size, Value *File, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI)
EmitFWrite - Emit a call to the fwrite function.
Value * EmitStrNLen(Value *Ptr, Value *MaxLen, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI)
EmitStrNLen - Emit a call to the strnlen function to the builder, for the specified pointer...
Value * EmitUnaryFloatFnCall(Value *Op, StringRef Name, IRBuilder<> &B, const AttributeSet &Attrs)
EmitUnaryFloatFnCall - Emit a call to the unary function named 'Name' (e.g.
Value * EmitPutS(Value *Str, IRBuilder<> &B, const TargetLibraryInfo *TLI)
EmitPutS - Emit a call to the puts function.
Value * EmitFPutS(Value *Str, Value *File, IRBuilder<> &B, const TargetLibraryInfo *TLI)
EmitFPutS - Emit a call to the puts function.
Value * EmitMemCpyChk(Value *Dst, Value *Src, Value *Len, Value *ObjSize, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI)
EmitMemCpyChk - 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")
EmitStrCpy - Emit a call to the strcpy function to the builder, for the specified pointer arguments...
Value * EmitStrChr(Value *Ptr, char C, IRBuilder<> &B, const TargetLibraryInfo *TLI)
EmitStrChr - Emit a call to the strchr function to the builder, for the specified pointer and charact...
Value * EmitStrNCmp(Value *Ptr1, Value *Ptr2, Value *Len, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI)
EmitStrNCmp - Emit a call to the strncmp function to the builder.
Value * CastToCStr(Value *V, IRBuilder<> &B)
CastToCStr - Return V if it is an i8*, otherwise cast it to i8*.
Value * EmitFPutC(Value *Char, Value *File, IRBuilder<> &B, const TargetLibraryInfo *TLI)
EmitFPutC - Emit a call to the fputc function.
Value * EmitStrNCpy(Value *Dst, Value *Src, Value *Len, IRBuilder<> &B, const TargetLibraryInfo *TLI, StringRef Name="strncpy")
EmitStrNCpy - Emit a call to the strncpy function to the builder, for the specified pointer arguments...
Value * EmitMemCmp(Value *Ptr1, Value *Ptr2, Value *Len, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI)
EmitMemCmp - Emit a call to the memcmp function.
Value * EmitMemChr(Value *Ptr, Value *Val, Value *Len, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI)
EmitMemChr - Emit a call to the memchr function.
C - The default llvm calling convention, compatible with C.
Value * EmitBinaryFloatFnCall(Value *Op1, Value *Op2, StringRef Name, IRBuilder<> &B, const AttributeSet &Attrs)
EmitUnaryFloatFnCall - Emit a call to the binary function named 'Name' (e.g.