38 if (!TLI->
has(LibFunc::strlen))
49 "strlen", AttributeSet::get(M->
getContext(), AS),
63 if (!TLI->
has(LibFunc::strnlen))
89 if (!TLI->
has(LibFunc::strchr))
102 I8Ptr, I8Ptr, I32Ty,
nullptr);
113 if (!TLI->
has(LibFunc::strncmp))
140 if (!TLI->
has(LibFunc::strcpy))
151 I8Ptr, I8Ptr, I8Ptr,
nullptr);
163 if (!TLI->
has(LibFunc::strncpy))
190 if (!TLI->
has(LibFunc::memcpy_chk))
214 if (!TLI->
has(LibFunc::memchr))
236 if (!TLI->
has(LibFunc::memcmp))
319 if (!TLI->
has(LibFunc::putchar))
341 if (!TLI->
has(LibFunc::puts))
356 if (
const Function *
F = dyn_cast<Function>(PutS->stripPointerCasts()))
365 if (!TLI->
has(LibFunc::fputc))
389 if (
const Function *Fn = dyn_cast<Function>(F->stripPointerCasts()))
398 if (!TLI->
has(LibFunc::fputs))
430 if (!TLI->
has(LibFunc::fwrite))
444 FWriteName, AttributeSet::get(M->
getContext(), AS),
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...
A parsed version of the target data layout string in and methods for querying it. ...
Value * CreateIntCast(Value *V, Type *DestTy, bool isSigned, const Twine &Name="")
A Module instance is used to store all the information related to an LLVM module. ...
CallInst - This class represents a function call, abstracting a target machine's calling convention...
bool isDoubleTy() const
isDoubleTy - Return true if this is 'double', a 64-bit IEEE fp type.
Value * EmitFWrite(Value *Ptr, Value *Size, Value *File, IRBuilder<> &B, const DataLayout &DL, const TargetLibraryInfo *TLI)
EmitFWrite - Emit a call to the fwrite function.
const Function * getParent() const
Return the enclosing method, or null if none.
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
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...
void setCallingConv(CallingConv::ID CC)
IntegerType * getInt32Ty()
Fetch the type representing a 32-bit integer.
bool has(LibFunc::Func F) const
Tests whether a library function is available.
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.
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
Function creates no aliases of pointer.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
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...
static void AppendTypeSuffix(Value *Op, StringRef &Name, SmallString< 20 > &NameBuffer)
Append a suffix to the function name according to the type of 'Op'.
Constant * stripPointerCasts()
Constant * getOrInsertFunction(StringRef Name, FunctionType *T, AttributeSet AttributeList)
Look up the specified function in the module symbol table.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
This is an important base class in LLVM.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
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...
bool isFloatTy() const
isFloatTy - Return true if this is 'float', a 32-bit IEEE fp type.
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.
Function doesn't unwind stack.
bool isPointerTy() const
isPointerTy - True if this is an instance of PointerType.
CallInst * CreateCall(Value *Callee, ArrayRef< Value * > Args=None, const Twine &Name="")
PointerType * getInt8PtrTy(unsigned AddrSpace=0)
Fetch the type representing a pointer to an 8-bit integer value.
IntegerType * getIntPtrType(LLVMContext &C, unsigned AddressSpace=0) const
Returns an integer type with size at least as big as that of a pointer in the given address space...
Value * CastToCStr(Value *V, IRBuilder<> &B)
CastToCStr - Return V if it is an i8*, otherwise cast it to i8*.
Value * CreateBitCast(Value *V, Type *DestTy, const Twine &Name="")
Module.h This file contains the declarations for the Module class.
Type * getType() const
All values are typed, get the type of this value.
Provides information about what library functions are available for the current target.
BasicBlock * GetInsertBlock() const
Value * stripPointerCasts()
Strip off pointer casts, all-zero GEPs, and aliases.
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
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...
Function only reads from memory.
StringRef getName(LibFunc::Func F) const
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.
void setAttributes(const AttributeSet &Attrs)
setAttributes - Set the parameter attributes for this call.
LLVMContext & getContext() const
Get the context in which this basic block lives.
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
StringRef - Represent a constant reference to a string, i.e.
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.
LLVMContext & getContext() const
Get the global data context.
AttrKind
This enumeration lists the attributes that can be associated with parameters, function results...