40 void Argument::anchor() { }
51 void Argument::setParent(
Function *parent) {
59 assert(F &&
"Argument is not in a function");
63 for (; &*AI !=
this; ++AI)
73 if (!
getType()->isPointerTy())
return false;
78 getType()->getPointerAddressSpace() == 0)
86 if (!
getType()->isPointerTy())
return false;
103 if (!
getType()->isPointerTy())
return false;
108 if (!
getType()->isPointerTy())
return false;
115 assert(
getType()->isPointerTy() &&
"Only pointers have alignments");
122 "Only pointers have dereferenceable bytes");
128 "Only pointers have dereferenceable bytes");
135 if (!
getType()->isPointerTy())
return false;
142 if (!
getType()->isPointerTy())
return false;
149 if (!
getType()->isPointerTy())
return false;
156 if (!
getType()->isPointerTy())
return false;
190 "Trying to add more than one attribute set to an argument!");
200 "Trying to remove more than one attribute set from an argument!");
221 unsigned Mask = 1 << IsMaterializableBit;
259 "invalid return type");
264 SymTab = make_unique<ValueSymbolTable>();
268 setValueSubclassData(1);
285 ArgumentList.
clear();
291 void Function::BuildLazyArguments()
const {
296 "Cannot have void typed arguments!");
302 const_cast<Function*
>(
this)->setValueSubclassData(SDC &= ~(1<<0));
312 "Expected arguments to be unused in declaration");
313 ArgumentList.
clear();
322 ArgumentList.
splice(ArgumentList.end(), Src.ArgumentList);
350 while (!BasicBlocks.empty())
351 BasicBlocks.begin()->eraseFromParent();
418 setValueSubclassDataBit(14, !Str.empty());
426 setValueSubclassDataBit(14,
false);
454 #define GET_INTRINSIC_NAME_TABLE
455 #include "llvm/IR/Intrinsics.gen"
456 #undef GET_INTRINSIC_NAME_TABLE
460 #define GET_INTRINSIC_TARGET_DATA
461 #include "llvm/IR/Intrinsics.gen"
462 #undef GET_INTRINSIC_TARGET_DATA
475 auto It = std::lower_bound(Targets.begin(), Targets.end(),
Target,
476 [](
const IntrinsicTargetInfo &TI,
480 const auto &TI = It != Targets.end() && It->Name == Target ? *It : Targets[0];
499 bool IsPrefixMatch = Name.
size() > strlen(NameTable[Idx]);
530 if (
PointerType* PTyp = dyn_cast<PointerType>(Ty)) {
533 }
else if (
ArrayType* ATyp = dyn_cast<ArrayType>(Ty)) {
536 }
else if (
StructType* STyp = dyn_cast<StructType>(Ty)) {
537 assert(!STyp->isLiteral() &&
"TODO: implement literal types");
538 Result += STyp->getName();
539 }
else if (
FunctionType* FT = dyn_cast<FunctionType>(Ty)) {
547 }
else if (isa<VectorType>(Ty))
558 "This version of getName does not support overloading");
565 for (
Type *Ty : Tys) {
624 unsigned StructElts = 2;
625 using namespace Intrinsic;
717 unsigned ArgInfo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
722 unsigned ArgInfo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
728 unsigned ArgInfo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
734 unsigned ArgInfo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
740 unsigned ArgInfo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
746 unsigned ArgInfo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
752 unsigned ArgInfo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
757 unsigned ArgInfo = (NextElt == Infos.
size() ? 0 : Infos[NextElt++]);
771 for (
unsigned i = 0;
i != StructElts; ++
i)
780 #define GET_INTRINSIC_GENERATOR_GLOBAL
781 #include "llvm/IR/Intrinsics.gen"
782 #undef GET_INTRINSIC_GENERATOR_GLOBAL
787 unsigned TableVal = IIT_Table[
id-1];
792 unsigned NextElt = 0;
793 if ((TableVal >> 31) != 0) {
795 IITEntries = IIT_LongEncodingTable;
798 NextElt = (TableVal << 1) >> 1;
807 IITEntries = IITValues;
813 while (NextElt != IITEntries.
size() && IITEntries[NextElt] != 0)
820 using namespace Intrinsic;
821 IITDescriptor
D = Infos.
front();
822 Infos = Infos.
slice(1);
840 D.Pointer_AddressSpace);
843 assert(
D.Struct_NumElements <= 5 &&
"Can't handle this yet");
844 for (
unsigned i = 0, e =
D.Struct_NumElements;
i != e; ++
i)
850 return Tys[
D.getArgumentNumber()];
852 Type *Ty = Tys[
D.getArgumentNumber()];
853 if (
VectorType *VTy = dyn_cast<VectorType>(Ty))
859 Type *Ty = Tys[
D.getArgumentNumber()];
860 if (
VectorType *VTy = dyn_cast<VectorType>(Ty))
869 Tys[
D.getArgumentNumber()]));
872 Type *Ty = Tys[
D.getArgumentNumber()];
873 if (
VectorType *VTy = dyn_cast<VectorType>(Ty)) {
879 Type *Ty = Tys[
D.getArgumentNumber()];
883 Type *Ty = Tys[
D.getArgumentNumber()];
891 Type *Ty = Tys[
D.getArgumentNumber()];
914 while (!TableRef.
empty())
927 #define GET_INTRINSIC_OVERLOAD_TABLE
928 #include "llvm/IR/Intrinsics.gen"
929 #undef GET_INTRINSIC_OVERLOAD_TABLE
937 case Intrinsic::experimental_gc_statepoint:
938 case Intrinsic::experimental_patchpoint_void:
939 case Intrinsic::experimental_patchpoint_i64:
945 #define GET_INTRINSIC_ATTRIBUTES
946 #include "llvm/IR/Intrinsics.gen"
947 #undef GET_INTRINSIC_ATTRIBUTES
958 #define GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN
959 #include "llvm/IR/Intrinsics.gen"
960 #undef GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN
963 #define GET_LLVM_INTRINSIC_FOR_MS_BUILTIN
964 #include "llvm/IR/Intrinsics.gen"
965 #undef GET_LLVM_INTRINSIC_FOR_MS_BUILTIN
969 using namespace Intrinsic;
972 if (Infos.
empty())
return true;
974 Infos = Infos.
slice(1);
1002 for (
unsigned i = 0, e =
D.Struct_NumElements;
i != e; ++
i)
1011 if (
D.getArgumentNumber() < ArgTys.
size())
1012 return Ty != ArgTys[
D.getArgumentNumber()];
1016 assert(
D.getArgumentNumber() == ArgTys.
size() &&
"Table consistency error");
1019 switch (
D.getArgumentKind()) {
1030 if (
D.getArgumentNumber() >= ArgTys.
size())
1033 Type *NewTy = ArgTys[
D.getArgumentNumber()];
1034 if (
VectorType *VTy = dyn_cast<VectorType>(NewTy))
1036 else if (
IntegerType *ITy = dyn_cast<IntegerType>(NewTy))
1045 if (
D.getArgumentNumber() >= ArgTys.
size())
1048 Type *NewTy = ArgTys[
D.getArgumentNumber()];
1049 if (
VectorType *VTy = dyn_cast<VectorType>(NewTy))
1051 else if (
IntegerType *ITy = dyn_cast<IntegerType>(NewTy))
1060 return D.getArgumentNumber() >= ArgTys.
size() ||
1061 !isa<VectorType>(ArgTys[
D.getArgumentNumber()]) ||
1063 cast<VectorType>(ArgTys[
D.getArgumentNumber()])) != Ty;
1065 if (
D.getArgumentNumber() >= ArgTys.
size())
1070 if (!ThisArgType || !ReferenceType ||
1072 ThisArgType->getVectorNumElements()))
1078 if (
D.getArgumentNumber() >= ArgTys.
size())
1080 Type * ReferenceType = ArgTys[
D.getArgumentNumber()];
1082 return (!ThisArgType || ThisArgType->
getElementType() != ReferenceType);
1085 if (
D.getArgumentNumber() >= ArgTys.
size())
1091 return (!ThisArgType || !ReferenceType ||
1095 if (
D.getArgumentNumber() >= ArgTys.
size())
1100 if (!ThisArgVecTy || !ReferenceType ||
1102 ThisArgVecTy->getVectorNumElements()))
1123 if (Infos.
size() != 1)
1128 Infos = Infos.
slice(1);
1129 if (D.
Kind == IITDescriptor::VarArg)
1152 for (
auto Ty : FTy->
params())
1165 assert(NewDecl->getFunctionType() == FTy &&
"Shouldn't change the signature");
1173 const User *FU = U.getUser();
1174 if (isa<BlockAddress>(FU))
1176 if (!isa<CallInst>(FU) && !isa<InvokeInst>(FU)) {
1199 if (!isa<BlockAddress>(U))
1211 if (CS && CS.
hasFnAttr(Attribute::ReturnsTwice))
1220 return cast<Constant>(Op<0>());
1224 setHungoffOperand<0>(Fn);
1225 setValueSubclassDataBit(3, Fn !=
nullptr);
1230 return cast<Constant>(Op<1>());
1234 setHungoffOperand<1>(PrefixData);
1235 setValueSubclassDataBit(1, PrefixData !=
nullptr);
1240 return cast<Constant>(Op<2>());
1244 setHungoffOperand<2>(PrologueData);
1245 setValueSubclassDataBit(2, PrologueData !=
nullptr);
1248 void Function::allocHungoffUselist() {
1264 void Function::setHungoffOperand(
Constant *
C) {
1266 allocHungoffUselist();
1274 void Function::setValueSubclassDataBit(
unsigned Bit,
bool On) {
1275 assert(Bit < 16 &&
"SubclassData contains only 16 bits");
1291 if (MDS->getString().equals(
"function_entry_count")) {
1309 assert(dyn_cast<MDString>(MD->getOperand(0))
1311 .equals(
"function_section_prefix") &&
1312 "Metadata not match");
bool hasNoCaptureAttr() const
Return true if this argument has the nocapture attribute on it in its containing function.
static unsigned getBitWidth(Type *Ty, const DataLayout &DL)
Returns the bitwidth of the given scalar or pointer type (if unknown returns 0).
bool hasNoAliasAttr() const
Return true if this argument has the noalias attribute on it in its containing function.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef drop_front(size_t N=1) const
Return a StringRef equal to 'this' but with the first N elements dropped.
bool isDefTriviallyDead() const
isDefTriviallyDead - Return true if it is trivially safe to remove this function definition from the ...
bool matchIntrinsicType(Type *Ty, ArrayRef< IITDescriptor > &Infos, SmallVectorImpl< Type * > &ArgTys)
Match the specified type (which comes from an intrinsic argument or return value) with the type const...
bool hasAttribute(unsigned i, Attribute::AttrKind Kind) const
check if an attributes is in the list of attributes.
bool hasLazyArguments() const
hasLazyArguments/CheckLazyArguments - The argument list of a function is built on demand...
void push_back(const T &Elt)
iterator_range< use_iterator > uses()
static Type * getDoubleTy(LLVMContext &C)
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
LLVM Argument representation.
Constant * getPrologueData() const
Get the prologue data associated with this function.
bool onlyReadsMemory() const
Return true if this argument has the readonly or readnone attribute on it in its containing function...
uint64_t getZExtValue() const
Get zero extended value.
void dropAllReferences()
Drop all references to operands.
iterator erase(iterator where)
A Module instance is used to store all the information related to an LLVM module. ...
unsigned getNumParams() const
Return the number of fixed parameters this function type requires.
const std::string & getGC(const Function &Fn)
Return the GC for a function.
const T & front() const
front - Get the first element.
void addDereferenceableAttr(unsigned i, uint64_t Bytes)
adds the dereferenceable attribute to the list of attributes.
bool hasByValOrInAllocaAttr() const
Return true if this argument has the byval attribute or inalloca attribute on it in its containing fu...
unsigned getNumOperands() const
void setGC(const Function &Fn, std::string GCName)
Define the GC for a function.
Type * getValueType() const
ArrayRef< Type * > params() const
void setGC(std::string Str)
static PointerType * get(Type *ElementType, unsigned AddressSpace)
This constructs a pointer to an object of the specified type in a numbered address space...
bool hasSwiftSelfAttr() const
Return true if this argument has the swiftself attribute.
bool isDoubleTy() const
Return true if this is 'double', a 64-bit IEEE fp type.
bool isOverloaded(ID id)
Returns true if the intrinsic can be overloaded.
bool hasAvailableExternallyLinkage() const
void setSectionPrefix(StringRef Prefix)
Set the section prefix for this function.
bool isTokenTy() const
Return true if this is 'token'.
Type * getReturnType() const
Returns the type of the ret val.
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly...
bool hasPrologueData() const
Check whether this function has prologue data.
The two locations do not alias at all.
This is a type descriptor which explains the type requirements of an intrinsic.
static bool isValidReturnType(Type *RetTy)
Return true if the specified type is valid as a return type.
unsigned getAddressSpace() const
Return the address space of the Pointer type.
unsigned getBitWidth() const
Get the number of bits in this IntegerType.
FunctionType * getType(LLVMContext &Context, ID id, ArrayRef< Type * > Tys=None)
Return the function type for an intrinsic.
static Type * getMetadataTy(LLVMContext &C)
Type * getElementType() const
static VectorType * getTruncatedElementVectorType(VectorType *VTy)
This static method is like getInteger except that the element types are half as wide as the elements ...
bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const
Return true if the attribute exists at the given index.
static Type * getX86_MMXTy(LLVMContext &C)
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
bool isMaterializable() const
uint64_t getDereferenceableBytes(unsigned i) const
Extract the number of dereferenceable bytes for a call or parameter (0=unknown).
StringRef getName() const
Return a constant reference to the value's name.
void removeAttributes(unsigned i, AttributeSet Attrs)
removes the attributes from the list of attributes.
unsigned getGlobalObjectSubClassData() const
void addAttr(AttributeSet AS)
Add a Attribute to an argument.
ArrayRef< T > slice(size_t N, size_t M) const
slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array...
std::string getEVTString() const
getEVTString - This function returns value type as a string, e.g.
static Type * getTokenTy(LLVMContext &C)
inst_iterator inst_begin(Function *F)
bool hasGC() const
hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm to use during code generatio...
StringRef getName(ID id)
Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx".
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
bool hasSwiftErrorAttr() const
Return true if this argument has the swifterror attribute.
static Type * getFloatTy(LLVMContext &C)
const APInt & getValue() const
Return the constant as an APInt value reference.
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
Class to represent struct types.
A Use represents the edge between a Value definition and its users.
void deleteGC(const Function &Fn)
Remove the GC for a function.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
static GCRegistry::Add< StatepointGC > D("statepoint-example","an example strategy for statepoint")
Optional< StringRef > getSectionPrefix() const
Get the section prefix for this function.
Constant * getPersonalityFn() const
Get the personality function associated with this function.
static StringRef getName(Value *V)
AttributeSet addDereferenceableAttr(LLVMContext &C, unsigned Index, uint64_t Bytes) const
Add the dereferenceable attribute to the attribute set at the given index.
void setName(const Twine &Name)
Change the name of the value.
uint64_t getDereferenceableOrNullBytes() const
If this argument has the dereferenceable_or_null attribute on it in its containing function...
void addAttributes(unsigned i, AttributeSet Attrs)
adds the attributes to the list of attributes.
Type * getVectorElementType() const
uint64_t getDereferenceableBytes() const
If this argument has the dereferenceable attribute on it in its containing function, return the number of bytes known to be dereferenceable.
void removeAttr(AttributeSet AS)
Remove a Attribute from an argument.
LLVM_NODISCARD bool empty() const
llvm::Optional< Function * > remangleIntrinsicFunction(Function *F)
Class to represent function types.
IIT_Info
IIT_Info - These are enumerators that describe the entries returned by the getIntrinsicInfoTableEntri...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
bool hasStructRetAttr() const
Return true if this argument has the sret attribute on it in its containing function.
bool isHalfTy() const
Return true if this is 'half', a 16-bit IEEE fp type.
Class to represent array types.
static FunctionType * get(Type *Result, ArrayRef< Type * > Params, bool isVarArg)
This static method is the primary way of constructing a FunctionType.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
static std::string utostr(uint64_t X, bool isNeg=false)
Function * getDeclaration(Module *M, ID id, ArrayRef< Type * > Tys=None)
Create or insert an LLVM Function declaration for an intrinsic, and return it.
void addDereferenceableOrNullAttr(unsigned i, uint64_t Bytes)
adds the dereferenceable_or_null attribute to the list of attributes.
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
bool hasNestAttr() const
Return true if this argument has the nest attribute on it in its containing function.
Optional< uint64_t > getEntryCount() const
Get the entry count for this function.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
Type * getElementType() const
size_t size() const
size - Get the array size.
Class to represent pointers.
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
static std::string getMangledTypeStr(Type *Ty)
Returns a stable mangling for the type specified for use in the name mangling scheme used by 'any' ty...
bool isX86_MMXTy() const
Return true if this is X86 MMX.
bool isIntOrIntVectorTy() const
Return true if this is an integer type or a vector of integer types.
void setCallingConv(CallingConv::ID CC)
unsigned getNumSlots() const
Return the number of slots used in this attribute list.
Type * getParamType(unsigned i) const
Parameter type accessors.
static VectorType * getHalfElementsVectorType(VectorType *VTy)
This static method returns a VectorType with half as many elements as the input type and the same ele...
void stealArgumentListFrom(Function &Src)
Steal arguments from another function.
static ConstantPointerNull * get(PointerType *T)
Static factory methods - Return objects of the specified value.
bool isLeaf(ID id)
Returns true if the intrinsic is a leaf, i.e.
static Intrinsic::ID lookupIntrinsicID(StringRef Name)
This does the actual lookup of an intrinsic ID which matches the given function name.
Constant * getOrInsertFunction(StringRef Name, FunctionType *T, AttributeSet AttributeList)
Look up the specified function in the module symbol table.
LLVM Basic Block Representation.
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.
const Function * getParent() const
bool hasAttribute(Attribute::AttrKind Kind) const
Checks if an argument has a given attribute.
AttributeSet addAttribute(LLVMContext &C, unsigned Index, Attribute::AttrKind Kind) const
Add an attribute to the attribute set at the given index.
Type * getElementType(unsigned N) const
This is an important base class in LLVM.
bool hasInAllocaAttr() const
Return true if this argument has the inalloca attribute on it in its containing function.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
bool isFloatTy() const
Return true if this is 'float', a 32-bit IEEE fp type.
void removeAttribute(unsigned i, Attribute::AttrKind Kind)
removes the attribute from the list of attributes.
unsigned getParamAlignment() const
If this is a byval or inalloca argument, return its alignment.
bool hasPersonalityFn() const
Check whether this function has a personality function.
void addAttribute(unsigned i, Attribute::AttrKind Kind)
adds the attribute to the list of attributes.
static Type * getVoidTy(LLVMContext &C)
void splice(iterator where, iplist_impl &L2)
bool hasSExtAttr() const
Return true if this argument has the sext attribute on it in its containing function.
uint64_t getNumElements() const
void copyAttributesFrom(const GlobalValue *Src) override
copyAttributesFrom - copy all additional attributes (those not needed to create a Function) from the ...
bool hasFnAttr(Attribute::AttrKind Kind) const
Return true if this function has the given attribute.
static IITDescriptor get(IITDescriptorKind K, unsigned Field)
void recalculateIntrinsicID()
Recalculate the ID for this function if it is an Intrinsic defined in llvm/Intrinsics.h.
Intrinsic::ID IntID
The intrinsic ID for this subclass (which must be a Function).
self_iterator getIterator()
Class to represent integer types.
bool empty() const
empty - Check if the array is empty.
MDNode * createFunctionEntryCount(uint64_t Count)
Return metadata containing the entry count for a function.
bool isFPOrFPVectorTy() const
Return true if this is a FP type or a vector of FP.
static ArrayRef< const char * > findTargetSubtable(StringRef Name)
Find the segment of IntrinsicNameTable for intrinsics with the same target as Name, or the generic table if Name is not target specific.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void setEntryCount(uint64_t Count)
Set the entry count for this function.
bool hasByValAttr() const
Return true if this argument has the byval attribute on it in its containing function.
const FunctionListType & getFunctionList() const
Get the Module's list of functions (constant).
static Type * getHalfTy(LLVMContext &C)
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
const MDOperand & getOperand(unsigned I) const
uint64_t getDereferenceableOrNullBytes(unsigned i) const
Extract the number of dereferenceable_or_null bytes for a call or parameter (0=unknown).
Iterator for intrusive lists based on ilist_node.
static PointerType * getInt1PtrTy(LLVMContext &C, unsigned AS=0)
enum llvm::Intrinsic::IITDescriptor::IITDescriptorKind Kind
bool matchIntrinsicVarArg(bool isVarArg, ArrayRef< IITDescriptor > &Infos)
Verify if the intrinsic has variable arguments.
static PointerType * getUnqual(Type *ElementType)
This constructs a pointer to an object of the specified type in the generic address space (address sp...
This is the shared class of boolean and integer constants.
static StructType * get(LLVMContext &Context, ArrayRef< Type * > Elements, bool isPacked=false)
This static method is the primary way to create a literal StructType.
void getIntrinsicInfoTableEntries(ID id, SmallVectorImpl< IITDescriptor > &T)
Return the IIT table descriptor for the specified intrinsic into an array of IITDescriptors.
Module.h This file contains the declarations for the Module class.
Type * getType() const
All values are typed, get the type of this value.
static const char * Target
void dropAllReferences()
dropAllReferences() - This method causes all the subinstructions to "let go" of all references that t...
void copyAttributesFrom(const GlobalValue *Src) override
Copy all additional attributes (those not needed to create a GlobalValue) from the GlobalValue Src to...
bool hasZExtAttr() const
Return true if this argument has the zext attribute on it in its containing function.
static VectorType * getExtendedElementVectorType(VectorType *VTy)
This static method is like getInteger except that the element types are twice as wide as the elements...
Intrinsic::ID getIntrinsicID() const LLVM_READONLY
getIntrinsicID - This method returns the ID number of the specified function, or Intrinsic::not_intri...
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
AttributeSet getAttributes() const
Return the attribute list for this Function.
AttributeSet removeAttributes(LLVMContext &C, unsigned Index, AttributeSet Attrs) const
Remove the specified attributes at the specified index from this attribute list.
Class to represent vector types.
Target - Wrapper for Target specific information.
Argument(Type *Ty, const Twine &Name="", Function *F=nullptr)
Constructor.
void push_back(pointer val)
LLVM_NODISCARD std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
bool isIntegerTy() const
True if this is an instance of IntegerType.
iterator_range< user_iterator > users()
unsigned HasLLVMReservedName
True if the function's name starts with "llvm.".
unsigned getVectorNumElements() const
bool hasNonNullAttr() const
Return true if this argument has the nonnull attribute on it in its containing function.
void setIsMaterializable(bool V)
static void DecodeIITType(unsigned &NextElt, ArrayRef< unsigned char > Infos, SmallVectorImpl< Intrinsic::IITDescriptor > &OutputTable)
void eraseFromParent() override
eraseFromParent - This method unlinks 'this' from the containing module and deletes it...
MDNode * getMetadata(unsigned KindID) const
Get the current metadata attachments for the given kind, if any.
AttributeSet removeAttribute(LLVMContext &C, unsigned Index, Attribute::AttrKind Kind) const
Remove the specified attribute at the specified index from this attribute list.
void setMetadata(unsigned KindID, MDNode *MD)
Set a particular kind of metadata attachment.
void setAttributes(AttributeSet Attrs)
Set the attribute list for this Function.
bool hasLinkOnceLinkage() const
pointer remove(iterator &IT)
PointerType * getType() const
Global values are always pointers.
bool hasAddressTaken(const User **=nullptr) const
hasAddressTaken - returns true if there are any uses of this function other than direct calls or invo...
void removeFromParent() override
removeFromParent - This method unlinks 'this' from the containing module, but does not delete it...
unsigned short getSubclassDataFromValue() const
bool isDeclaration() const
Return true if the primary definition of this global value is outside of the current translation unit...
unsigned getSlotIndex(unsigned Slot) const
Return the index for the given slot.
AttributeSet addDereferenceableOrNullAttr(LLVMContext &C, unsigned Index, uint64_t Bytes) const
Add the dereferenceable_or_null attribute to the attribute set at the given index.
ImmutableCallSite - establish a view to a call site for examination.
const std::string & getGC() const
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
FunctionType * getFunctionType() const
Returns the FunctionType for me.
bool callsFunctionThatReturnsTwice() const
callsFunctionThatReturnsTwice - Return true if the function has a call to setjmp or other function th...
void setPrologueData(Constant *PrologueData)
Compile-time customization of User operands.
bool hasPrefixData() const
Check whether this function has prefix data.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
Constant * getPrefixData() const
Get the prefix data associated with this function.
static EVT getEVT(Type *Ty, bool HandleUnknown=false)
getEVT - Return the value type corresponding to the specified type.
AttributeSet getAttributes(LLVMContext &C, ID id)
Return the attributes for an intrinsic.
bool hasLocalLinkage() const
int lookupLLVMIntrinsicByName(ArrayRef< const char * > NameTable, StringRef Name)
Looks up Name in NameTable via binary search.
Type * getReturnType() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
unsigned getParamAlignment(unsigned i) const
Extract the alignment for a call or parameter (0=unknown).
static Type * DecodeFixedType(ArrayRef< Intrinsic::IITDescriptor > &Infos, ArrayRef< Type * > Tys, LLVMContext &Context)
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
const ArgumentListType & getArgumentList() const
Get the underlying elements of the Function...
unsigned getArgNo() const
Return the index of this formal argument in its containing function.
static VectorType * get(Type *ElementType, unsigned NumElements)
This static method is the primary way to construct an VectorType.
void allocHungoffUses(unsigned N, bool IsPhi=false)
Allocate the array of Uses, followed by a pointer (with bottom bit set) to the User.
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
static const char *const IntrinsicNameTable[]
Table of string intrinsic names indexed by enum value.
MDNode * createFunctionSectionPrefix(StringRef Prefix)
Return metadata containing the section prefix for a function.
StringRef - Represent a constant reference to a string, i.e.
inst_iterator inst_end(Function *F)
void setPersonalityFn(Constant *Fn)
void setNumHungOffUseOperands(unsigned NumOps)
Subclasses with hung off uses need to manage the operand count themselves.
unsigned getNumElements() const
Random access to the elements.
AttributeSet addAttributes(LLVMContext &C, unsigned Index, AttributeSet Attrs) const
Add attributes to the attribute set at the given index.
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")
bool isVarArg() const
isVarArg - Return true if this function takes a variable number of arguments.
void setGlobalObjectSubClassData(unsigned Val)
bool hasReturnedAttr() const
Return true if this argument has the returned attribute on it in its containing function.
void dropAllReferences()
Cause all subinstructions to "let go" of all the references that said subinstructions are maintaining...
LLVMContext & getContext() const
Get the global data context.
bool isCallee(Value::const_user_iterator UI) const
isCallee - Determine whether the passed iterator points to the callee operand's Use.
bool isVoidTy() const
Return true if this is 'void'.
AttrKind
This enumeration lists the attributes that can be associated with parameters, function results...
bool isMetadataTy() const
Return true if this is 'metadata'.
void setPrefixData(Constant *PrefixData)