LLVM
13.0.0git
|
#include "llvm/IR/Function.h"
Classes | |
class | ProfileCount |
Class to represent profile counts. More... | |
Public Member Functions | |
bool | hasLazyArguments () const |
hasLazyArguments/CheckLazyArguments - The argument list of a function is built on demand, so that the list isn't allocated until the first client needs it. More... | |
Function (const Function &)=delete | |
void | operator= (const Function &)=delete |
~Function () | |
const Function & | getFunction () const |
DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value) | |
unsigned | getInstructionCount () const |
Returns the number of non-debug IR instructions in this function. More... | |
FunctionType * | getFunctionType () const |
Returns the FunctionType for me. More... | |
Type * | getReturnType () const |
Returns the type of the ret val. More... | |
LLVMContext & | getContext () const |
getContext - Return a reference to the LLVMContext associated with this function. More... | |
bool | isVarArg () const |
isVarArg - Return true if this function takes a variable number of arguments. More... | |
bool | isMaterializable () const |
void | setIsMaterializable (bool V) |
Intrinsic::ID | getIntrinsicID () const LLVM_READONLY |
getIntrinsicID - This method returns the ID number of the specified function, or Intrinsic::not_intrinsic if the function is not an intrinsic, or if the pointer is null. More... | |
bool | isIntrinsic () const |
isIntrinsic - Returns true if the function's name starts with "llvm.". More... | |
bool | isTargetIntrinsic () const |
isTargetIntrinsic - Returns true if this function is an intrinsic and the intrinsic is specific to a certain target. More... | |
bool | isConstrainedFPIntrinsic () const |
Returns true if the function is one of the "Constrained Floating-Point
Intrinsics". More... | |
void | recalculateIntrinsicID () |
Recalculate the ID for this function if it is an Intrinsic defined in llvm/Intrinsics.h. More... | |
CallingConv::ID | getCallingConv () const |
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this function. More... | |
void | setCallingConv (CallingConv::ID CC) |
AttributeList | getAttributes () const |
Return the attribute list for this Function. More... | |
void | setAttributes (AttributeList Attrs) |
Set the attribute list for this Function. More... | |
void | addFnAttr (Attribute::AttrKind Kind) |
Add function attributes to this function. More... | |
void | addFnAttr (StringRef Kind, StringRef Val=StringRef()) |
Add function attributes to this function. More... | |
void | addFnAttr (Attribute Attr) |
Add function attributes to this function. More... | |
void | removeFnAttr (Attribute::AttrKind Kind) |
Remove function attributes from this function. More... | |
void | removeFnAttr (StringRef Kind) |
Remove function attribute from this function. More... | |
bool | isPresplitCoroutine () const |
A function will have the "coroutine.presplit" attribute if it's a coroutine and has not gone through full CoroSplit pass. More... | |
void | setEntryCount (ProfileCount Count, const DenseSet< GlobalValue::GUID > *Imports=nullptr) |
Set the entry count for this function. More... | |
void | setEntryCount (uint64_t Count, ProfileCountType Type=PCT_Real, const DenseSet< GlobalValue::GUID > *Imports=nullptr) |
A convenience wrapper for setting entry count. More... | |
ProfileCount | getEntryCount (bool AllowSynthetic=false) const |
Get the entry count for this function. More... | |
bool | hasProfileData (bool IncludeSynthetic=false) const |
Return true if the function is annotated with profile data. More... | |
DenseSet< GlobalValue::GUID > | getImportGUIDs () const |
Returns the set of GUIDs that needs to be imported to the function for sample PGO, to enable the same inlines as the profiled optimized binary. More... | |
void | setSectionPrefix (StringRef Prefix) |
Set the section prefix for this function. More... | |
Optional< StringRef > | getSectionPrefix () const |
Get the section prefix for this function. More... | |
bool | hasFnAttribute (Attribute::AttrKind Kind) const |
Return true if the function has the attribute. More... | |
bool | hasFnAttribute (StringRef Kind) const |
Return true if the function has the attribute. More... | |
Attribute | getFnAttribute (Attribute::AttrKind Kind) const |
Return the attribute for the given attribute kind. More... | |
Attribute | getFnAttribute (StringRef Kind) const |
Return the attribute for the given attribute kind. More... | |
unsigned | getFnStackAlignment () const |
Return the stack alignment for the function. More... | |
MaybeAlign | getFnStackAlign () const |
Return the stack alignment for the function. More... | |
bool | hasGC () const |
hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm to use during code generation. More... | |
const std::string & | getGC () const |
void | setGC (std::string Str) |
void | clearGC () |
bool | hasStackProtectorFnAttr () const |
Returns true if the function has ssp, sspstrong, or sspreq fn attrs. More... | |
void | addAttribute (unsigned i, Attribute::AttrKind Kind) |
adds the attribute to the list of attributes. More... | |
void | addAttribute (unsigned i, Attribute Attr) |
adds the attribute to the list of attributes. More... | |
void | addAttributes (unsigned i, const AttrBuilder &Attrs) |
adds the attributes to the list of attributes. More... | |
void | addParamAttr (unsigned ArgNo, Attribute::AttrKind Kind) |
adds the attribute to the list of attributes for the given arg. More... | |
void | addParamAttr (unsigned ArgNo, Attribute Attr) |
adds the attribute to the list of attributes for the given arg. More... | |
void | addParamAttrs (unsigned ArgNo, const AttrBuilder &Attrs) |
adds the attributes to the list of attributes for the given arg. More... | |
void | removeAttribute (unsigned i, Attribute::AttrKind Kind) |
removes the attribute from the list of attributes. More... | |
void | removeAttribute (unsigned i, StringRef Kind) |
removes the attribute from the list of attributes. More... | |
void | removeAttributes (unsigned i, const AttrBuilder &Attrs) |
removes the attributes from the list of attributes. More... | |
void | removeParamAttr (unsigned ArgNo, Attribute::AttrKind Kind) |
removes the attribute from the list of attributes. More... | |
void | removeParamAttr (unsigned ArgNo, StringRef Kind) |
removes the attribute from the list of attributes. More... | |
void | removeParamAttrs (unsigned ArgNo, const AttrBuilder &Attrs) |
removes the attribute from the list of attributes. More... | |
bool | hasAttribute (unsigned i, Attribute::AttrKind Kind) const |
check if an attributes is in the list of attributes. More... | |
bool | hasParamAttribute (unsigned ArgNo, Attribute::AttrKind Kind) const |
check if an attributes is in the list of attributes. More... | |
Attribute | getParamAttribute (unsigned ArgNo, Attribute::AttrKind Kind) const |
gets the specified attribute from the list of attributes. More... | |
Attribute | getAttribute (unsigned i, Attribute::AttrKind Kind) const |
gets the attribute from the list of attributes. More... | |
Attribute | getAttribute (unsigned i, StringRef Kind) const |
gets the attribute from the list of attributes. More... | |
void | addDereferenceableAttr (unsigned i, uint64_t Bytes) |
adds the dereferenceable attribute to the list of attributes. More... | |
void | addDereferenceableParamAttr (unsigned ArgNo, uint64_t Bytes) |
adds the dereferenceable attribute to the list of attributes for the given arg. More... | |
void | addDereferenceableOrNullAttr (unsigned i, uint64_t Bytes) |
adds the dereferenceable_or_null attribute to the list of attributes. More... | |
void | addDereferenceableOrNullParamAttr (unsigned ArgNo, uint64_t Bytes) |
adds the dereferenceable_or_null attribute to the list of attributes for the given arg. More... | |
unsigned | getParamAlignment (unsigned ArgNo) const |
Extract the alignment for a call or parameter (0=unknown). More... | |
MaybeAlign | getParamAlign (unsigned ArgNo) const |
Type * | getParamByValType (unsigned ArgNo) const |
Extract the byval type for a parameter. More... | |
Type * | getParamStructRetType (unsigned ArgNo) const |
Extract the sret type for a parameter. More... | |
Type * | getParamByRefType (unsigned ArgNo) const |
Extract the byref type for a parameter. More... | |
uint64_t | getDereferenceableBytes (unsigned i) const |
Extract the number of dereferenceable bytes for a call or parameter (0=unknown). More... | |
uint64_t | getParamDereferenceableBytes (unsigned ArgNo) const |
Extract the number of dereferenceable bytes for a parameter. More... | |
uint64_t | getDereferenceableOrNullBytes (unsigned i) const |
Extract the number of dereferenceable_or_null bytes for a call or parameter (0=unknown). More... | |
uint64_t | getParamDereferenceableOrNullBytes (unsigned ArgNo) const |
Extract the number of dereferenceable_or_null bytes for a parameter. More... | |
bool | doesNotAccessMemory () const |
Determine if the function does not access memory. More... | |
void | setDoesNotAccessMemory () |
bool | onlyReadsMemory () const |
Determine if the function does not access or only reads memory. More... | |
void | setOnlyReadsMemory () |
bool | doesNotReadMemory () const |
Determine if the function does not access or only writes memory. More... | |
void | setDoesNotReadMemory () |
bool | onlyAccessesArgMemory () const |
Determine if the call can access memmory only using pointers based on its arguments. More... | |
void | setOnlyAccessesArgMemory () |
bool | onlyAccessesInaccessibleMemory () const |
Determine if the function may only access memory that is inaccessible from the IR. More... | |
void | setOnlyAccessesInaccessibleMemory () |
bool | onlyAccessesInaccessibleMemOrArgMem () const |
Determine if the function may only access memory that is either inaccessible from the IR or pointed to by its arguments. More... | |
void | setOnlyAccessesInaccessibleMemOrArgMem () |
bool | doesNotReturn () const |
Determine if the function cannot return. More... | |
void | setDoesNotReturn () |
bool | doesNoCfCheck () const |
Determine if the function should not perform indirect branch tracking. More... | |
bool | doesNotThrow () const |
Determine if the function cannot unwind. More... | |
void | setDoesNotThrow () |
bool | cannotDuplicate () const |
Determine if the call cannot be duplicated. More... | |
void | setCannotDuplicate () |
bool | isConvergent () const |
Determine if the call is convergent. More... | |
void | setConvergent () |
void | setNotConvergent () |
bool | isSpeculatable () const |
Determine if the call has sideeffects. More... | |
void | setSpeculatable () |
bool | doesNotFreeMemory () const |
Determine if the call might deallocate memory. More... | |
void | setDoesNotFreeMemory () |
bool | doesNotRecurse () const |
Determine if the function is known not to recurse, directly or indirectly. More... | |
void | setDoesNotRecurse () |
bool | mustProgress () const |
Determine if the function is required to make forward progress. More... | |
void | setMustProgress () |
bool | willReturn () const |
Determine if the function will return. More... | |
void | setWillReturn () |
bool | hasUWTable () const |
True if the ABI mandates (or the user requested) that this function be in a unwind table. More... | |
void | setHasUWTable () |
bool | needsUnwindTableEntry () const |
True if this function needs an unwind table. More... | |
bool | hasStructRetAttr () const |
Determine if the function returns a structure through first or second pointer argument. More... | |
bool | returnDoesNotAlias () const |
Determine if the parameter or return value is marked with NoAlias attribute. More... | |
void | setReturnDoesNotAlias () |
bool | hasOptNone () const |
Do not optimize this function (-O0). More... | |
bool | hasMinSize () const |
Optimize this function for minimum size (-Oz). More... | |
bool | hasOptSize () const |
Optimize this function for size (-Os) or minimum size (-Oz). More... | |
DenormalMode | getDenormalMode (const fltSemantics &FPType) const |
Returns the denormal handling type for the default rounding mode of the function. More... | |
void | copyAttributesFrom (const Function *Src) |
copyAttributesFrom - copy all additional attributes (those not needed to create a Function) from the Function Src to this one. More... | |
void | deleteBody () |
deleteBody - This method deletes the body of the function, and converts the linkage to external. More... | |
void | removeFromParent () |
removeFromParent - This method unlinks 'this' from the containing module, but does not delete it. More... | |
void | eraseFromParent () |
eraseFromParent - This method unlinks 'this' from the containing module and deletes it. More... | |
void | stealArgumentListFrom (Function &Src) |
Steal arguments from another function. More... | |
const BasicBlockListType & | getBasicBlockList () const |
Get the underlying elements of the Function... More... | |
BasicBlockListType & | getBasicBlockList () |
const BasicBlock & | getEntryBlock () const |
BasicBlock & | getEntryBlock () |
ValueSymbolTable * | getValueSymbolTable () |
getSymbolTable() - Return the symbol table if any, otherwise nullptr. More... | |
const ValueSymbolTable * | getValueSymbolTable () const |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
size_t | size () const |
bool | empty () const |
const BasicBlock & | front () const |
BasicBlock & | front () |
const BasicBlock & | back () const |
BasicBlock & | back () |
size_t | arg_size () const |
bool | arg_empty () const |
bool | hasPersonalityFn () const |
Check whether this function has a personality function. More... | |
Constant * | getPersonalityFn () const |
Get the personality function associated with this function. More... | |
void | setPersonalityFn (Constant *Fn) |
bool | hasPrefixData () const |
Check whether this function has prefix data. More... | |
Constant * | getPrefixData () const |
Get the prefix data associated with this function. More... | |
void | setPrefixData (Constant *PrefixData) |
bool | hasPrologueData () const |
Check whether this function has prologue data. More... | |
Constant * | getPrologueData () const |
Get the prologue data associated with this function. More... | |
void | setPrologueData (Constant *PrologueData) |
void | print (raw_ostream &OS, AssemblyAnnotationWriter *AAW=nullptr, bool ShouldPreserveUseListOrder=false, bool IsForDebug=false) const |
Print the function to an output stream with an optional AssemblyAnnotationWriter. More... | |
void | viewCFG () const |
viewCFG - This function is meant for use from the debugger. More... | |
void | viewCFG (bool ViewCFGOnly, const BlockFrequencyInfo *BFI, const BranchProbabilityInfo *BPI) const |
Extended form to print edge weights. More... | |
void | viewCFGOnly () const |
viewCFGOnly - This function is meant for use from the debugger. More... | |
void | viewCFGOnly (const BlockFrequencyInfo *BFI, const BranchProbabilityInfo *BPI) const |
Extended form to print edge weights. More... | |
void | dropAllReferences () |
dropAllReferences() - This method causes all the subinstructions to "let
go" of all references that they are maintaining. More... | |
bool | hasAddressTaken (const User **=nullptr, bool IgnoreCallbackUses=false, bool IgnoreAssumeLikeCalls=false, bool IngoreLLVMUsed=false) const |
hasAddressTaken - returns true if there are any uses of this function other than direct calls or invokes to it, or blockaddress expressions. More... | |
bool | isDefTriviallyDead () const |
isDefTriviallyDead - Return true if it is trivially safe to remove this function definition from the module (because it isn't externally visible, does not have its address taken, and has no callers). More... | |
bool | callsFunctionThatReturnsTwice () const |
callsFunctionThatReturnsTwice - Return true if the function has a call to setjmp or other function that gcc recognizes as "returning twice". More... | |
void | setSubprogram (DISubprogram *SP) |
Set the attached subprogram. More... | |
DISubprogram * | getSubprogram () const |
Get the attached subprogram. More... | |
bool | isDebugInfoForProfiling () const |
Returns true if we should emit debug info for profiling. More... | |
bool | nullPointerIsDefined () const |
Check if null pointer dereferencing is considered undefined behavior for the function. More... | |
Function Argument Iteration | |
arg_iterator | arg_begin () |
const_arg_iterator | arg_begin () const |
arg_iterator | arg_end () |
const_arg_iterator | arg_end () const |
Argument * | getArg (unsigned i) const |
iterator_range< arg_iterator > | args () |
iterator_range< const_arg_iterator > | args () const |
![]() | |
GlobalObject (const GlobalObject &)=delete | |
unsigned | getAlignment () const |
FIXME: Remove this function once transition to Align is over. More... | |
MaybeAlign | getAlign () const |
Returns the alignment of the given variable or function. More... | |
void | setAlignment (MaybeAlign Align) |
unsigned | getGlobalObjectSubClassData () const |
void | setGlobalObjectSubClassData (unsigned Val) |
bool | hasSection () const |
Check if this global has a custom object file section. More... | |
StringRef | getSection () const |
Get the custom section of this global if it has one. More... | |
void | setSection (StringRef S) |
Change the section for this global. More... | |
bool | hasComdat () const |
const Comdat * | getComdat () const |
Comdat * | getComdat () |
void | setComdat (Comdat *C) |
void | copyMetadata (const GlobalObject *Src, unsigned Offset) |
Copy metadata from Src, adjusting offsets by Offset. More... | |
void | addTypeMetadata (unsigned Offset, Metadata *TypeID) |
void | setVCallVisibilityMetadata (VCallVisibility Visibility) |
VCallVisibility | getVCallVisibility () const |
bool | canIncreaseAlignment () const |
Returns true if the alignment of the value can be unilaterally increased. More... | |
void | addMetadata (unsigned KindID, MDNode &MD) |
Add a metadata attachment. More... | |
void | addMetadata (StringRef Kind, MDNode &MD) |
void | clearMetadata () |
Erase all metadata attached to this Value. More... | |
bool | eraseMetadata (unsigned KindID) |
Erase all metadata attachments with the given kind. More... | |
void | getAllMetadata (SmallVectorImpl< std::pair< unsigned, MDNode * >> &MDs) const |
Appends all metadata attached to this value to MDs , sorting by KindID. More... | |
MDNode * | getMetadata (unsigned KindID) const |
Get the current metadata attachments for the given kind, if any. More... | |
MDNode * | getMetadata (StringRef Kind) const |
void | getMetadata (unsigned KindID, SmallVectorImpl< MDNode * > &MDs) const |
Appends all attachments with the given ID to MDs in insertion order. More... | |
void | getMetadata (StringRef Kind, SmallVectorImpl< MDNode * > &MDs) const |
bool | hasMetadata () const |
Return true if this value has any metadata attached to it. More... | |
bool | hasMetadata (unsigned KindID) const |
Return true if this value has the given type of metadata attached. More... | |
bool | hasMetadata (StringRef Kind) const |
void | setMetadata (unsigned KindID, MDNode *Node) |
Set a particular kind of metadata attachment. More... | |
void | setMetadata (StringRef Kind, MDNode *Node) |
![]() | |
GlobalValue (const GlobalValue &)=delete | |
unsigned | getAddressSpace () const |
bool | hasGlobalUnnamedAddr () const |
bool | hasAtLeastLocalUnnamedAddr () const |
Returns true if this value's address is not significant in this module. More... | |
UnnamedAddr | getUnnamedAddr () const |
void | setUnnamedAddr (UnnamedAddr Val) |
bool | hasComdat () const |
const Comdat * | getComdat () const |
Comdat * | getComdat () |
VisibilityTypes | getVisibility () const |
bool | hasDefaultVisibility () const |
bool | hasHiddenVisibility () const |
bool | hasProtectedVisibility () const |
void | setVisibility (VisibilityTypes V) |
bool | isThreadLocal () const |
If the value is "Thread Local", its value isn't shared by the threads. More... | |
void | setThreadLocal (bool Val) |
void | setThreadLocalMode (ThreadLocalMode Val) |
ThreadLocalMode | getThreadLocalMode () const |
DLLStorageClassTypes | getDLLStorageClass () const |
bool | hasDLLImportStorageClass () const |
bool | hasDLLExportStorageClass () const |
void | setDLLStorageClass (DLLStorageClassTypes C) |
bool | hasSection () const |
StringRef | getSection () const |
PointerType * | getType () const |
Global values are always pointers. More... | |
Type * | getValueType () const |
bool | isImplicitDSOLocal () const |
void | setDSOLocal (bool Local) |
bool | isDSOLocal () const |
bool | hasPartition () const |
StringRef | getPartition () const |
void | setPartition (StringRef Part) |
bool | isDefinitionExact () const |
Return true if the currently visible definition of this global (if any) is exactly the definition we will see at runtime. More... | |
bool | hasExactDefinition () const |
Return true if this global has an exact defintion. More... | |
bool | isInterposable () const |
Return true if this global's definition can be substituted with an arbitrary definition at link time or load time. More... | |
bool | canBenefitFromLocalAlias () const |
bool | hasExternalLinkage () const |
bool | hasAvailableExternallyLinkage () const |
bool | hasLinkOnceLinkage () const |
bool | hasLinkOnceODRLinkage () const |
bool | hasWeakLinkage () const |
bool | hasWeakAnyLinkage () const |
bool | hasWeakODRLinkage () const |
bool | hasAppendingLinkage () const |
bool | hasInternalLinkage () const |
bool | hasPrivateLinkage () const |
bool | hasLocalLinkage () const |
bool | hasExternalWeakLinkage () const |
bool | hasCommonLinkage () const |
bool | hasValidDeclarationLinkage () const |
void | setLinkage (LinkageTypes LT) |
LinkageTypes | getLinkage () const |
bool | isDiscardableIfUnused () const |
bool | isWeakForLinker () const |
std::string | getGlobalIdentifier () const |
Return the modified name for this global value suitable to be used as the key for a global lookup (e.g. More... | |
GUID | getGUID () const |
Return a 64-bit global unique ID constructed from global value name (i.e. More... | |
bool | isDeclaration () const |
Return true if the primary definition of this global value is outside of the current translation unit. More... | |
bool | isDeclarationForLinker () const |
bool | isStrongDefinitionForLinker () const |
Returns true if this global's definition will be the one chosen by the linker. More... | |
const GlobalObject * | getBaseObject () const |
GlobalObject * | getBaseObject () |
bool | isAbsoluteSymbolRef () const |
Returns whether this is a reference to an absolute symbol. More... | |
Optional< ConstantRange > | getAbsoluteSymbolRange () const |
If this is an absolute symbol reference, returns the range of the symbol, otherwise returns None. More... | |
void | removeFromParent () |
This method unlinks 'this' from the containing module, but does not delete it. More... | |
void | eraseFromParent () |
This method unlinks 'this' from the containing module and deletes it. More... | |
Module * | getParent () |
Get the module that this global value is contained inside of... More... | |
const Module * | getParent () const |
bool | canBeOmittedFromSymbolTable () const |
True if GV can be left out of the object symbol table. More... | |
bool | isMaterializable () const |
If this function's Module is being lazily streamed in functions from disk or some other source, this method can be used to check to see if the function has been read in yet or not. More... | |
Error | materialize () |
Make sure this GlobalValue is fully read. More... | |
![]() | |
void | operator= (const Constant &)=delete |
Constant (const Constant &)=delete | |
bool | isNullValue () const |
Return true if this is the value that would be returned by getNullValue. More... | |
bool | isOneValue () const |
Returns true if the value is one. More... | |
bool | isNotOneValue () const |
Return true if the value is not the one value, or, for vectors, does not contain one value elements. More... | |
bool | isAllOnesValue () const |
Return true if this is the value that would be returned by getAllOnesValue. More... | |
bool | isNegativeZeroValue () const |
Return true if the value is what would be returned by getZeroValueForNegation. More... | |
bool | isZeroValue () const |
Return true if the value is negative zero or null value. More... | |
bool | isNotMinSignedValue () const |
Return true if the value is not the smallest signed value, or, for vectors, does not contain smallest signed value elements. More... | |
bool | isMinSignedValue () const |
Return true if the value is the smallest signed value. More... | |
bool | isFiniteNonZeroFP () const |
Return true if this is a finite and non-zero floating-point scalar constant or a fixed width vector constant with all finite and non-zero elements. More... | |
bool | isNormalFP () const |
Return true if this is a normal (as opposed to denormal, infinity, nan, or zero) floating-point scalar constant or a vector constant with all normal elements. More... | |
bool | hasExactInverseFP () const |
Return true if this scalar has an exact multiplicative inverse or this vector has an exact multiplicative inverse for each element in the vector. More... | |
bool | isNaN () const |
Return true if this is a floating-point NaN constant or a vector floating-point constant with all NaN elements. More... | |
bool | isElementWiseEqual (Value *Y) const |
Return true if this constant and a constant 'Y' are element-wise equal. More... | |
bool | containsUndefOrPoisonElement () const |
Return true if this is a vector constant that includes any undef or poison elements. More... | |
bool | containsPoisonElement () const |
Return true if this is a vector constant that includes any poison elements. More... | |
bool | containsConstantExpression () const |
Return true if this is a fixed width vector constant that includes any constant expressions. More... | |
bool | canTrap () const |
Return true if evaluation of this constant could trap. More... | |
bool | isThreadDependent () const |
Return true if the value can vary between threads. More... | |
bool | isDLLImportDependent () const |
Return true if the value is dependent on a dllimport variable. More... | |
bool | isConstantUsed () const |
Return true if the constant has users other than constant expressions and other dangling things. More... | |
bool | needsRelocation () const |
This method classifies the entry according to whether or not it may generate a relocation entry (either static or dynamic). More... | |
bool | needsDynamicRelocation () const |
Constant * | getAggregateElement (unsigned Elt) const |
For aggregates (struct/array/vector) return the constant that corresponds to the specified element if possible, or null if not. More... | |
Constant * | getAggregateElement (Constant *Elt) const |
Constant * | getSplatValue (bool AllowUndefs=false) const |
If all elements of the vector constant have the same value, return that value. More... | |
const APInt & | getUniqueInteger () const |
If C is a constant integer then return its value, otherwise C must be a vector of constant integers, all equal, and the common value is returned. More... | |
void | destroyConstant () |
Called if some element of this constant is no longer valid. More... | |
void | handleOperandChange (Value *, Value *) |
This method is a special form of User::replaceUsesOfWith (which does not work on constants) that does work on constants. More... | |
void | removeDeadConstantUsers () const |
If there are any dead constant users dangling off of this constant, remove them. More... | |
const Constant * | stripPointerCasts () const |
Constant * | stripPointerCasts () |
![]() | |
User (const User &)=delete | |
void | operator delete (void *Usr) |
Free memory allocated for User and Use objects. More... | |
void | operator delete (void *Usr, unsigned) |
Placement delete - required by std, called if the ctor throws. More... | |
void | operator delete (void *Usr, unsigned, unsigned) |
Placement delete - required by std, called if the ctor throws. More... | |
const Use * | getOperandList () const |
Use * | getOperandList () |
Value * | getOperand (unsigned i) const |
void | setOperand (unsigned i, Value *Val) |
const Use & | getOperandUse (unsigned i) const |
Use & | getOperandUse (unsigned i) |
unsigned | getNumOperands () const |
ArrayRef< const uint8_t > | getDescriptor () const |
Returns the descriptor co-allocated with this User instance. More... | |
MutableArrayRef< uint8_t > | getDescriptor () |
Returns the descriptor co-allocated with this User instance. More... | |
void | setGlobalVariableNumOperands (unsigned NumOps) |
Set the number of operands on a GlobalVariable. More... | |
void | setNumHungOffUseOperands (unsigned NumOps) |
Subclasses with hung off uses need to manage the operand count themselves. More... | |
bool | isDroppable () const |
A droppable user is a user for which uses can be dropped without affecting correctness and should be dropped rather than preventing a transformation from happening. More... | |
op_iterator | op_begin () |
const_op_iterator | op_begin () const |
op_iterator | op_end () |
const_op_iterator | op_end () const |
op_range | operands () |
const_op_range | operands () const |
value_op_iterator | value_op_begin () |
value_op_iterator | value_op_end () |
iterator_range< value_op_iterator > | operand_values () |
const_value_op_iterator | value_op_begin () const |
const_value_op_iterator | value_op_end () const |
iterator_range< const_value_op_iterator > | operand_values () const |
void | dropAllReferences () |
Drop all references to operands. More... | |
void | replaceUsesOfWith (Value *From, Value *To) |
Replace uses of one Value with another. More... | |
![]() | |
Value (const Value &)=delete | |
Value & | operator= (const Value &)=delete |
void | deleteValue () |
Delete a pointer to a generic Value. More... | |
void | dump () const |
Support for debugging, callable in GDB: V->dump() More... | |
Type * | getType () const |
All values are typed, get the type of this value. More... | |
LLVMContext & | getContext () const |
All values hold a context through their type. More... | |
bool | hasName () const |
ValueName * | getValueName () const |
void | setValueName (ValueName *VN) |
StringRef | getName () const |
Return a constant reference to the value's name. More... | |
void | setName (const Twine &Name) |
Change the name of the value. More... | |
void | takeName (Value *V) |
Transfer the name from V to this value. More... | |
std::string | getNameOrAsOperand () const |
void | replaceAllUsesWith (Value *V) |
Change all uses of this to point to a new Value. More... | |
void | replaceNonMetadataUsesWith (Value *V) |
Change non-metadata uses of this to point to a new Value. More... | |
void | replaceUsesWithIf (Value *New, llvm::function_ref< bool(Use &U)> ShouldReplace) |
Go through the uses list for this definition and make each use point to "V" if the callback ShouldReplace returns true for the given Use. More... | |
void | replaceUsesOutsideBlock (Value *V, BasicBlock *BB) |
replaceUsesOutsideBlock - Go through the uses list for this definition and make each use point to "V" instead of "this" when the use is outside the block. More... | |
void | assertModuleIsMaterializedImpl () const |
void | assertModuleIsMaterialized () const |
bool | use_empty () const |
bool | materialized_use_empty () const |
use_iterator | materialized_use_begin () |
const_use_iterator | materialized_use_begin () const |
use_iterator | use_begin () |
const_use_iterator | use_begin () const |
use_iterator | use_end () |
const_use_iterator | use_end () const |
iterator_range< use_iterator > | materialized_uses () |
iterator_range< const_use_iterator > | materialized_uses () const |
iterator_range< use_iterator > | uses () |
iterator_range< const_use_iterator > | uses () const |
bool | user_empty () const |
user_iterator | materialized_user_begin () |
const_user_iterator | materialized_user_begin () const |
user_iterator | user_begin () |
const_user_iterator | user_begin () const |
user_iterator | user_end () |
const_user_iterator | user_end () const |
User * | user_back () |
const User * | user_back () const |
iterator_range< user_iterator > | materialized_users () |
iterator_range< const_user_iterator > | materialized_users () const |
iterator_range< user_iterator > | users () |
iterator_range< const_user_iterator > | users () const |
bool | hasOneUse () const |
Return true if there is exactly one use of this value. More... | |
bool | hasNUses (unsigned N) const |
Return true if this Value has exactly N uses. More... | |
bool | hasNUsesOrMore (unsigned N) const |
Return true if this value has N uses or more. More... | |
bool | hasOneUser () const |
Return true if there is exactly one user of this value. More... | |
Use * | getSingleUndroppableUse () |
Return true if there is exactly one use of this value that cannot be dropped. More... | |
const Use * | getSingleUndroppableUse () const |
bool | hasNUndroppableUses (unsigned N) const |
Return true if there this value. More... | |
bool | hasNUndroppableUsesOrMore (unsigned N) const |
Return true if this value has N uses or more. More... | |
void | dropDroppableUses (llvm::function_ref< bool(const Use *)> ShouldDrop=[](const Use *) { return true;}) |
Remove every uses that can safely be removed. More... | |
void | dropDroppableUsesIn (User &Usr) |
Remove every use of this value in User that can safely be removed. More... | |
bool | isUsedInBasicBlock (const BasicBlock *BB) const |
Check if this value is used in the specified basic block. More... | |
unsigned | getNumUses () const |
This method computes the number of uses of this Value. More... | |
void | addUse (Use &U) |
This method should only be used by the Use class. More... | |
unsigned | getValueID () const |
Return an ID for the concrete type of this object. More... | |
unsigned | getRawSubclassOptionalData () const |
Return the raw optional flags value contained in this value. More... | |
void | clearSubclassOptionalData () |
Clear the optional flags contained in this value. More... | |
bool | hasSameSubclassOptionalData (const Value *V) const |
Check the optional flags for equality. More... | |
bool | hasValueHandle () const |
Return true if there is a value handle associated with this value. More... | |
bool | isUsedByMetadata () const |
Return true if there is metadata referencing this value. More... | |
bool | isSwiftError () const |
Return true if this value is a swifterror value. More... | |
const Value * | stripPointerCasts () const |
Strip off pointer casts, all-zero GEPs and address space casts. More... | |
Value * | stripPointerCasts () |
const Value * | stripPointerCastsAndAliases () const |
Strip off pointer casts, all-zero GEPs, address space casts, and aliases. More... | |
Value * | stripPointerCastsAndAliases () |
const Value * | stripPointerCastsSameRepresentation () const |
Strip off pointer casts, all-zero GEPs and address space casts but ensures the representation of the result stays the same. More... | |
Value * | stripPointerCastsSameRepresentation () |
const Value * | stripPointerCastsForAliasAnalysis () const |
Strip off pointer casts, all-zero GEPs, single-argument phi nodes and invariant group info. More... | |
Value * | stripPointerCastsForAliasAnalysis () |
const Value * | stripInBoundsConstantOffsets () const |
Strip off pointer casts and all-constant inbounds GEPs. More... | |
Value * | stripInBoundsConstantOffsets () |
const Value * | stripAndAccumulateConstantOffsets (const DataLayout &DL, APInt &Offset, bool AllowNonInbounds, function_ref< bool(Value &Value, APInt &Offset)> ExternalAnalysis=nullptr) const |
Accumulate the constant offset this value has compared to a base pointer. More... | |
Value * | stripAndAccumulateConstantOffsets (const DataLayout &DL, APInt &Offset, bool AllowNonInbounds) |
const Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const |
This is a wrapper around stripAndAccumulateConstantOffsets with the in-bounds requirement set to false. More... | |
Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) |
const Value * | stripInBoundsOffsets (function_ref< void(const Value *)> Func=[](const Value *) {}) const |
Strip off pointer casts and inbounds GEPs. More... | |
Value * | stripInBoundsOffsets (function_ref< void(const Value *)> Func=[](const Value *) {}) |
uint64_t | getPointerDereferenceableBytes (const DataLayout &DL, bool &CanBeNull) const |
Returns the number of bytes known to be dereferenceable for the pointer value. More... | |
Align | getPointerAlignment (const DataLayout &DL) const |
Returns an alignment of the pointer value. More... | |
const Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const |
Translate PHI node to its predecessor from the given basic block. More... | |
Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) |
void | mutateType (Type *Ty) |
Mutate the type of this Value to be of the specified type. More... | |
template<class Compare > | |
void | sortUseList (Compare Cmp) |
Sort the use-list. More... | |
void | reverseUseList () |
Reverse the use-list. More... | |
void | print (raw_ostream &O, bool IsForDebug=false) const |
Implement operator<< on Value. More... | |
void | print (raw_ostream &O, ModuleSlotTracker &MST, bool IsForDebug=false) const |
void | printAsOperand (raw_ostream &O, bool PrintType=true, const Module *M=nullptr) const |
Print the name of this Value out to the specified raw_ostream. More... | |
void | printAsOperand (raw_ostream &O, bool PrintType, ModuleSlotTracker &MST) const |
![]() | |
self_iterator | getIterator () |
const_self_iterator | getIterator () const |
reverse_self_iterator | getReverseIterator () |
const_reverse_self_iterator | getReverseIterator () const |
bool | isSentinel () const |
Check whether this is the sentinel node. More... | |
Static Public Member Functions | |
static Function * | Create (FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace, const Twine &N="", Module *M=nullptr) |
static Function * | Create (FunctionType *Ty, LinkageTypes Linkage, const Twine &N="", Module *M=nullptr) |
static Function * | Create (FunctionType *Ty, LinkageTypes Linkage, const Twine &N, Module &M) |
Creates a new function and attaches it to a module. More... | |
static bool | isTargetIntrinsic (Intrinsic::ID IID) |
isTargetIntrinsic - Returns true if IID is an intrinsic specific to a certain target. More... | |
static Intrinsic::ID | lookupIntrinsicID (StringRef Name) |
This does the actual lookup of an intrinsic ID which matches the given function name. More... | |
static BasicBlockListType Function::* | getSublistAccess (BasicBlock *) |
static bool | classof (const Value *V) |
Methods for support type inquiry through isa, cast, and dyn_cast: More... | |
![]() | |
static bool | classof (const Value *V) |
![]() | |
static UnnamedAddr | getMinUnnamedAddr (UnnamedAddr A, UnnamedAddr B) |
static LinkageTypes | getLinkOnceLinkage (bool ODR) |
static LinkageTypes | getWeakLinkage (bool ODR) |
static bool | isExternalLinkage (LinkageTypes Linkage) |
static bool | isAvailableExternallyLinkage (LinkageTypes Linkage) |
static bool | isLinkOnceODRLinkage (LinkageTypes Linkage) |
static bool | isLinkOnceLinkage (LinkageTypes Linkage) |
static bool | isWeakAnyLinkage (LinkageTypes Linkage) |
static bool | isWeakODRLinkage (LinkageTypes Linkage) |
static bool | isWeakLinkage (LinkageTypes Linkage) |
static bool | isAppendingLinkage (LinkageTypes Linkage) |
static bool | isInternalLinkage (LinkageTypes Linkage) |
static bool | isPrivateLinkage (LinkageTypes Linkage) |
static bool | isLocalLinkage (LinkageTypes Linkage) |
static bool | isExternalWeakLinkage (LinkageTypes Linkage) |
static bool | isCommonLinkage (LinkageTypes Linkage) |
static bool | isValidDeclarationLinkage (LinkageTypes Linkage) |
static bool | isInterposableLinkage (LinkageTypes Linkage) |
Whether the definition of this global may be replaced by something non-equivalent at link time. More... | |
static bool | isDiscardableIfUnused (LinkageTypes Linkage) |
Whether the definition of this global may be discarded if it is not used in its compilation unit. More... | |
static bool | isWeakForLinker (LinkageTypes Linkage) |
Whether the definition of this global may be replaced at link time. More... | |
static StringRef | dropLLVMManglingEscape (StringRef Name) |
If the given string begins with the GlobalValue name mangling escape character '\1', drop it. More... | |
static std::string | getGlobalIdentifier (StringRef Name, GlobalValue::LinkageTypes Linkage, StringRef FileName) |
Return the modified name for a global value suitable to be used as the key for a global lookup (e.g. More... | |
static GUID | getGUID (StringRef GlobalName) |
Return a 64-bit global unique ID constructed from global value name (i.e. More... | |
static bool | classof (const Value *V) |
![]() | |
static bool | classof (const Value *V) |
static Constant * | getNullValue (Type *Ty) |
Constructor to create a '0' constant of arbitrary type. More... | |
static Constant * | getAllOnesValue (Type *Ty) |
static Constant * | getIntegerValue (Type *Ty, const APInt &V) |
Return the value for an integer or pointer constant, or a vector thereof, with the given scalar value. More... | |
static Constant * | replaceUndefsWith (Constant *C, Constant *Replacement) |
Try to replace undefined constant C or undefined elements in C with Replacement. More... | |
static Constant * | mergeUndefsWith (Constant *C, Constant *Other) |
Merges undefs of a Constant with another Constant, along with the undefs already present. More... | |
![]() | |
static bool | classof (const Value *V) |
![]() | |
static void | dropDroppableUse (Use &U) |
Remove the droppable use U . More... | |
Friends | |
class | SymbolTableListTraits< Function > |
Additional Inherited Members | |
![]() | |
static const unsigned | MaxAlignmentExponent = 29 |
The maximum alignment for instructions. More... | |
static const unsigned | MaximumAlignment = 1u << MaxAlignmentExponent |
![]() | |
enum | { LastAlignmentBit = 4, HasSectionHashEntryBit, GlobalObjectBits } |
![]() | |
enum | : unsigned { NumUserOperandsBits = 27 } |
The number of operands in the subclass. More... | |
![]() | |
using | self_iterator = ilist_iterator< ilist_detail::compute_node_options< Function, Options... >::type, false, false > |
using | const_self_iterator = ilist_iterator< ilist_detail::compute_node_options< Function, Options... >::type, false, true > |
using | reverse_self_iterator = ilist_iterator< ilist_detail::compute_node_options< Function, Options... >::type, true, false > |
using | const_reverse_self_iterator = ilist_iterator< ilist_detail::compute_node_options< Function, Options... >::type, true, true > |
![]() | |
GlobalObject (Type *Ty, ValueTy VTy, Use *Ops, unsigned NumOps, LinkageTypes Linkage, const Twine &Name, unsigned AddressSpace=0) | |
void | copyAttributesFrom (const GlobalObject *Src) |
![]() | |
GlobalValue (Type *Ty, ValueTy VTy, Use *Ops, unsigned NumOps, LinkageTypes Linkage, const Twine &Name, unsigned AddressSpace) | |
unsigned | getGlobalValueSubClassData () const |
void | setGlobalValueSubClassData (unsigned V) |
void | setParent (Module *parent) |
~GlobalValue () | |
void | copyAttributesFrom (const GlobalValue *Src) |
Copy all additional attributes (those not needed to create a GlobalValue) from the GlobalValue Src to this one. More... | |
![]() | |
Constant (Type *ty, ValueTy vty, Use *Ops, unsigned NumOps) | |
~Constant ()=default | |
![]() | |
void * | operator new (size_t Size) |
Allocate a User with an operand pointer co-allocated. More... | |
void * | operator new (size_t Size, unsigned Us) |
Allocate a User with the operands co-allocated. More... | |
void * | operator new (size_t Size, unsigned Us, unsigned DescBytes) |
Allocate a User with the operands co-allocated. More... | |
User (Type *ty, unsigned vty, Use *, unsigned NumOps) | |
void | allocHungoffUses (unsigned N, bool IsPhi=false) |
Allocate the array of Uses, followed by a pointer (with bottom bit set) to the User. More... | |
void | growHungoffUses (unsigned N, bool IsPhi=false) |
Grow the number of hung off uses. More... | |
~User ()=default | |
template<int Idx> | |
Use & | Op () |
template<int Idx> | |
const Use & | Op () const |
![]() | |
Value (Type *Ty, unsigned scid) | |
~Value () | |
Value's destructor should be virtual by design, but that would require that Value and all of its subclasses have a vtable that effectively duplicates the information in the value ID. More... | |
void | getAllMetadata (SmallVectorImpl< std::pair< unsigned, MDNode * >> &MDs) const |
Appends all metadata attached to this value to MDs , sorting by KindID. More... | |
bool | hasMetadata () const |
Return true if this value has any metadata attached to it. More... | |
bool | eraseMetadata (unsigned KindID) |
Erase all metadata attachments with the given kind. More... | |
void | clearMetadata () |
Erase all metadata attached to this Value. More... | |
unsigned short | getSubclassDataFromValue () const |
void | setValueSubclassData (unsigned short D) |
MDNode * | getMetadata (unsigned KindID) const |
Get the current metadata attachments for the given kind, if any. More... | |
MDNode * | getMetadata (StringRef Kind) const |
void | getMetadata (unsigned KindID, SmallVectorImpl< MDNode * > &MDs) const |
Appends all attachments with the given ID to MDs in insertion order. More... | |
void | getMetadata (StringRef Kind, SmallVectorImpl< MDNode * > &MDs) const |
bool | hasMetadata (unsigned KindID) const |
Return true if this value has the given type of metadata attached. More... | |
bool | hasMetadata (StringRef Kind) const |
void | setMetadata (unsigned KindID, MDNode *Node) |
Set a particular kind of metadata attachment. More... | |
void | setMetadata (StringRef Kind, MDNode *Node) |
void | addMetadata (unsigned KindID, MDNode &MD) |
Add a metadata attachment. More... | |
void | addMetadata (StringRef Kind, MDNode &MD) |
![]() | |
ilist_node_impl ()=default | |
![]() | |
template<int Idx, typename U > | |
static Use & | OpFrom (const U *that) |
![]() | |
Comdat * | ObjComdat |
![]() | |
Type * | ValueType |
unsigned | Linkage: 4 |
unsigned | Visibility: 2 |
unsigned | UnnamedAddrVal: 2 |
unsigned | DllStorageClass: 2 |
unsigned | ThreadLocal: 3 |
unsigned | HasLLVMReservedName: 1 |
True if the function's name starts with "llvm.". More... | |
unsigned | IsDSOLocal: 1 |
If true then there is a definition within the same linkage unit and that definition cannot be runtime preempted. More... | |
unsigned | HasPartition: 1 |
True if this symbol has a partition name assigned (see https://lld.llvm.org/Partitions.html). More... | |
Intrinsic::ID | IntID |
The intrinsic ID for this subclass (which must be a Function). More... | |
Module * | Parent |
![]() | |
unsigned char | SubclassOptionalData: 7 |
Hold subclass data that can be dropped. More... | |
unsigned | NumUserOperands: NumUserOperandsBits |
unsigned | IsUsedByMD: 1 |
unsigned | HasName: 1 |
unsigned | HasMetadata: 1 |
unsigned | HasHungOffUses: 1 |
unsigned | HasDescriptor: 1 |
![]() | |
static const unsigned | GlobalObjectSubClassDataBits |
![]() | |
static const unsigned | GlobalValueSubClassDataBits = 16 |
Definition at line 61 of file Function.h.
using llvm::Function::arg_iterator = Argument * |
Definition at line 69 of file Function.h.
Definition at line 63 of file Function.h.
using llvm::Function::const_arg_iterator = const Argument * |
Definition at line 70 of file Function.h.
Definition at line 67 of file Function.h.
Definition at line 66 of file Function.h.
Enumerator | |
---|---|
PCT_Invalid | |
PCT_Real | |
PCT_Synthetic |
Definition at line 277 of file Function.h.
Function::~Function | ( | ) |
Definition at line 366 of file Function.cpp.
References clearGC(), and dropAllReferences().
void Function::addAttribute | ( | unsigned | i, |
Attribute | Attr | ||
) |
adds the attribute to the list of attributes.
Definition at line 494 of file Function.cpp.
References llvm::AttributeList::addAttribute(), getAttributes(), getContext(), i, and setAttributes().
void Function::addAttribute | ( | unsigned | i, |
Attribute::AttrKind | Kind | ||
) |
adds the attribute to the list of attributes.
Definition at line 488 of file Function.cpp.
References llvm::AttributeList::addAttribute(), getAttributes(), getContext(), i, and setAttributes().
Referenced by addFnAttr(), addIfNotExistent(), LLVMCreateMCJITCompilerForModule(), and setReturnDoesNotAlias().
void Function::addAttributes | ( | unsigned | i, |
const AttrBuilder & | Attrs | ||
) |
adds the attributes to the list of attributes.
Definition at line 500 of file Function.cpp.
References llvm::AttributeList::addAttributes(), Attrs, getAttributes(), getContext(), i, and setAttributes().
Referenced by llvm::codegen::setFunctionAttributes().
void Function::addDereferenceableAttr | ( | unsigned | i, |
uint64_t | Bytes | ||
) |
adds the dereferenceable attribute to the list of attributes.
Definition at line 560 of file Function.cpp.
References llvm::AttributeList::addDereferenceableAttr(), getAttributes(), getContext(), i, and setAttributes().
void Function::addDereferenceableOrNullAttr | ( | unsigned | i, |
uint64_t | Bytes | ||
) |
adds the dereferenceable_or_null attribute to the list of attributes.
Definition at line 572 of file Function.cpp.
References llvm::AttributeList::addDereferenceableOrNullAttr(), getAttributes(), getContext(), i, and setAttributes().
void Function::addDereferenceableOrNullParamAttr | ( | unsigned | ArgNo, |
uint64_t | Bytes | ||
) |
adds the dereferenceable_or_null attribute to the list of attributes for the given arg.
Definition at line 578 of file Function.cpp.
References llvm::AttributeList::addDereferenceableOrNullParamAttr(), getAttributes(), getContext(), and setAttributes().
void Function::addDereferenceableParamAttr | ( | unsigned | ArgNo, |
uint64_t | Bytes | ||
) |
adds the dereferenceable attribute to the list of attributes for the given arg.
Definition at line 566 of file Function.cpp.
References llvm::AttributeList::addDereferenceableParamAttr(), getAttributes(), getContext(), and setAttributes().
|
inline |
Add function attributes to this function.
Definition at line 256 of file Function.h.
References addAttribute(), and llvm::AttributeList::FunctionIndex.
|
inline |
Add function attributes to this function.
Definition at line 245 of file Function.h.
References addAttribute(), and llvm::AttributeList::FunctionIndex.
Referenced by assureFPCallStub(), createDevirtTriggerFunc(), createFPFnStub(), fillOverallFunction(), handleAttr(), llvm::NVPTXTargetLowering::LowerCall(), EnumAttr::set(), StrBoolAttr::set(), setCannotDuplicate(), setConvergent(), setDoesNotAccessMemory(), setDoesNotFreeMemory(), setDoesNotReadMemory(), setDoesNotRecurse(), setDoesNotReturn(), setDoesNotThrow(), setHasUWTable(), setMustProgress(), setOnlyAccessesArgMemory(), setOnlyAccessesInaccessibleMemOrArgMem(), setOnlyAccessesInaccessibleMemory(), setOnlyReadsMemory(), setSpeculatable(), and setWillReturn().
Add function attributes to this function.
Definition at line 250 of file Function.h.
References addAttribute(), llvm::AttributeList::FunctionIndex, llvm::Attribute::get(), and getContext().
void Function::addParamAttr | ( | unsigned | ArgNo, |
Attribute | Attr | ||
) |
adds the attribute to the list of attributes for the given arg.
Definition at line 512 of file Function.cpp.
References llvm::AttributeList::addParamAttribute(), getAttributes(), getContext(), and setAttributes().
void Function::addParamAttr | ( | unsigned | ArgNo, |
Attribute::AttrKind | Kind | ||
) |
adds the attribute to the list of attributes for the given arg.
Definition at line 506 of file Function.cpp.
References llvm::AttributeList::addParamAttribute(), getAttributes(), getContext(), and setAttributes().
Referenced by llvm::Argument::addAttr(), and createCloneDeclaration().
void Function::addParamAttrs | ( | unsigned | ArgNo, |
const AttrBuilder & | Attrs | ||
) |
adds the attributes to the list of attributes for the given arg.
Definition at line 518 of file Function.cpp.
References llvm::AttributeList::addParamAttributes(), Attrs, getAttributes(), getContext(), and setAttributes().
|
inline |
Definition at line 762 of file Function.h.
References Arguments.
Referenced by args(), llvm::CloneFunction(), llvm::orc::cloneFunctionDecl(), llvm::FunctionComparator::compareSignature(), doPromotion(), getFrameLayout(), hasSameArgumentList(), llvm::InlineFunction(), internalizeFunction(), LLVMGetNextParam(), LLVMGetParam(), and llvm::SwiftErrorValueTracking::setFunction().
|
inline |
Definition at line 766 of file Function.h.
References Arguments.
|
inline |
Definition at line 796 of file Function.h.
References arg_size().
|
inline |
Definition at line 771 of file Function.h.
References Arguments.
Referenced by args(), llvm::FunctionComparator::compareSignature(), llvm::InlineFunction(), and llvm::SwiftErrorValueTracking::setFunction().
|
inline |
Definition at line 775 of file Function.h.
References Arguments.
|
inline |
Definition at line 795 of file Function.h.
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), arg_empty(), CC_X86_Intr(), llvm::CloneFunctionInto(), llvm::FunctionComparator::compareSignature(), createSwitchStatement(), llvm::X86FrameLowering::emitPrologue(), findArgumentCopyElisionCandidates(), llvm::CFLSteensAAResult::FunctionInfo::FunctionInfo(), llvm::IRPosition::getAssociatedArgument(), hasSameArgumentList(), LLVMGetNextParam(), llvm::Attributor::registerFunctionSignatureRewrite(), replaceCalledFunction(), and stealArgumentListFrom().
|
inline |
Definition at line 786 of file Function.h.
References arg_begin(), arg_end(), and llvm::make_range().
Referenced by AddAliasScopeMetadata(), AddAlignmentAssumptions(), llvm::AMDGPUTargetLowering::analyzeFormalArgumentsCompute(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneFunctionInto(), llvm::computeSignatureVTs(), llvm::CFLSteensAAResult::FunctionInfo::FunctionInfo(), llvm::HexagonEvaluator::HexagonEvaluator(), llvm::AArch64CallLowering::isEligibleForTailCallOptimization(), llvm::SITargetLowering::isEligibleForTailCallOptimization(), LLVMGetParams(), and populateExternalRelations().
|
inline |
Definition at line 789 of file Function.h.
References arg_begin(), arg_end(), and llvm::make_range().
|
inline |
Definition at line 757 of file Function.h.
|
inline |
Definition at line 756 of file Function.h.
Referenced by llvm::AttributeList::get().
|
inline |
Definition at line 747 of file Function.h.
Referenced by llvm::AttributeList::addAttribute(), llvm::CloneFunctionInto(), doPromotion(), llvm::AttributeSetNode::get(), llvm::AttributeList::get(), InitializeUniqueCases(), moveFunctionData(), llvm::GraphTraits< DOTFuncInfo * >::nodes_begin(), and llvm::GraphTraits< DOTFuncMSSAInfo * >::nodes_begin().
|
inline |
Definition at line 748 of file Function.h.
bool Function::callsFunctionThatReturnsTwice | ( | ) | const |
callsFunctionThatReturnsTwice - Return true if the function has a call to setjmp or other function that gcc recognizes as "returning twice".
Definition at line 1656 of file Function.cpp.
References I, and llvm::instructions().
Referenced by llvm::SelectionDAGISel::runOnMachineFunction().
|
inline |
Determine if the call cannot be duplicated.
Definition at line 593 of file Function.h.
References hasFnAttribute().
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition at line 855 of file Function.h.
References llvm::Value::getValueID().
void Function::clearGC | ( | ) |
Definition at line 610 of file Function.cpp.
References llvm::LLVMContext::deleteGC(), getContext(), and hasGC().
Referenced by copyAttributesFrom(), and ~Function().
copyAttributesFrom - copy all additional attributes (those not needed to create a Function) from the Function Src to this one.
Copy all additional attributes (those not needed to create a Function) from the Function Src to this one.
Definition at line 625 of file Function.cpp.
References clearGC(), llvm::GlobalObject::copyAttributesFrom(), getAttributes(), getCallingConv(), getGC(), getPersonalityFn(), getPrefixData(), getPrologueData(), hasGC(), hasPersonalityFn(), hasPrefixData(), hasPrologueData(), setAttributes(), setCallingConv(), setGC(), setPersonalityFn(), setPrefixData(), and setPrologueData().
Referenced by addVariantDeclaration(), llvm::orc::cloneFunctionDecl(), llvm::CloneFunctionInto(), llvm::CloneModule(), doPromotion(), and replaceWithTLIFunction().
|
static |
Creates a new function and attaches it to a module.
Places the function in the program address space as specified by the module's data layout.
Definition at line 312 of file Function.cpp.
References Create(), llvm::GlobalValue::Linkage, M, and N.
|
inlinestatic |
Definition at line 144 of file Function.h.
References llvm::GlobalValue::Linkage, M, and N.
|
inlinestatic |
Definition at line 137 of file Function.h.
References llvm::GlobalValue::Linkage, M, and N.
Referenced by addVariantDeclaration(), assureFPCallStub(), llvm::CloneFunction(), llvm::orc::cloneFunctionDecl(), llvm::CloneModule(), llvm::convertToDeclaration(), Create(), createCloneDeclaration(), createDevirtTriggerFunc(), llvm::MIRParserImpl::createDummyFunction(), createEmptyFunction(), createFPFnStub(), createFrameHelperMachineFunction(), createGlobalFwdRef(), llvm::createSanitizerCtor(), llvm::Attributor::createShallowWrapper(), llvm::ThunkInserter< Derived >::createThunkFunction(), createWrapper(), doPromotion(), llvm::orc::IRSpeculationLayer::emit(), llvm::SanitizerStatReport::finish(), getEmscriptenFunction(), llvm::Module::getOrInsertFunction(), internalizeFunction(), LLVMAddFunction(), replaceWithTLIFunction(), and UpgradeIntrinsicFunction1().
llvm::Function::DECLARE_TRANSPARENT_OPERAND_ACCESSORS | ( | Value | ) |
|
inline |
deleteBody - This method deletes the body of the function, and converts the linkage to external.
Definition at line 700 of file Function.h.
References dropAllReferences(), llvm::GlobalValue::ExternalLinkage, and llvm::GlobalValue::setLinkage().
Referenced by llvm::CallGraphUpdater::removeFunction().
|
inline |
Determine if the function should not perform indirect branch tracking.
Definition at line 582 of file Function.h.
References hasFnAttribute().
|
inline |
Determine if the function does not access memory.
Definition at line 525 of file Function.h.
References hasFnAttribute().
Referenced by doesNotReadMemory(), and onlyReadsMemory().
|
inline |
Determine if the call might deallocate memory.
Definition at line 620 of file Function.h.
References hasFnAttribute(), and onlyReadsMemory().
|
inline |
Determine if the function does not access or only writes memory.
Definition at line 541 of file Function.h.
References doesNotAccessMemory(), and hasFnAttribute().
|
inline |
Determine if the function is known not to recurse, directly or indirectly.
Definition at line 629 of file Function.h.
References hasFnAttribute().
Referenced by addNoRecurseAttrsTopDown().
|
inline |
Determine if the function cannot return.
Definition at line 574 of file Function.h.
References hasFnAttribute().
|
inline |
Determine if the function cannot unwind.
Definition at line 585 of file Function.h.
References hasFnAttribute().
Referenced by needsUnwindTableEntry(), llvm::EscapeEnumerator::Next(), and llvm::InstCombinerImpl::visitCallInst().
void Function::dropAllReferences | ( | ) |
dropAllReferences() - This method causes all the subinstructions to "let go" of all references that they are maintaining.
This allows one to 'delete' a whole module at a time, even though there may be circular references... first all references are dropped, and all use counts go to zero. Then everything is deleted for real. Note that no operations are valid on an object that has "dropped all references", except operator delete.
Since no other object in the module can have references into the body of a function, dropping all references deletes the entire body of the function, including any contained basic blocks.
Definition at line 466 of file Function.cpp.
References BB, llvm::Value::clearMetadata(), llvm::User::dropAllReferences(), llvm::User::getNumOperands(), llvm::Value::getSubclassDataFromValue(), setIsMaterializable(), and llvm::User::setNumHungOffUseOperands().
Referenced by deleteBody(), and ~Function().
|
inline |
Definition at line 753 of file Function.h.
Referenced by llvm::PMDataManager::emitInstrCountChangedRemark(), llvm::AttributeList::get(), llvm::DOTGraphTraits< SelectionDAG * >::getNodeAttributes(), getNodeLabel(), llvm::OpenMPIRBuilder::getOrCreateSrcLocStr(), llvm::HexagonTargetLowering::LowerOperationWrapper(), llvm::MCSectionMachO::ParseSectionSpecifier(), and llvm::HexagonTargetLowering::ReplaceNodeResults().
|
inline |
Definition at line 749 of file Function.h.
Referenced by llvm::AttributeList::addAttribute(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneFunctionInto(), fixupLineNumbers(), llvm::AttributeSetNode::get(), llvm::AttributeList::get(), moveFunctionData(), llvm::GraphTraits< DOTFuncInfo * >::nodes_end(), llvm::GraphTraits< DOTFuncMSSAInfo * >::nodes_end(), and placeSplitBlockCarefully().
|
inline |
Definition at line 750 of file Function.h.
void Function::eraseFromParent | ( | ) |
eraseFromParent - This method unlinks 'this' from the containing module and deletes it.
Definition at line 321 of file Function.cpp.
References llvm::Module::getFunctionList(), llvm::ilist_node_impl< ilist_detail::compute_node_options< Function, Options... >::type >::getIterator(), and llvm::GlobalValue::getParent().
Referenced by llvm::ArgumentPromotionPass::run(), stripDebugDeclareImpl(), llvm::stripDebugifyMetadata(), llvm::UpgradeARCRuntime(), and llvm::PredicateInfo::~PredicateInfo().
|
inline |
Definition at line 755 of file Function.h.
|
inline |
Definition at line 754 of file Function.h.
Referenced by llvm::CloneAndPruneFunctionInto(), llvm::CloneFunctionInto(), getEntryBlock(), llvm::InlineFunction(), and llvm::AllocaInst::isStaticAlloca().
|
inline |
Definition at line 780 of file Function.h.
References Arguments, assert(), and i.
Referenced by createSwitchStatement(), llvm::IRPosition::getAssociatedArgument(), inlineRetainOrClaimRVCalls(), replaceArgumentUses(), replaceCalledFunction(), and replaceConstants().
|
inline |
gets the attribute from the list of attributes.
Definition at line 445 of file Function.h.
References llvm::AttributeList::getAttribute(), and i.
Referenced by addIfNotExistent(), llvm::TargetLoweringObjectFileELF::getExplicitSectionGlobal(), getFnAttribute(), and llvm::CallLowering::setArgFlags().
gets the attribute from the list of attributes.
Definition at line 450 of file Function.h.
References llvm::AttributeList::getAttribute(), and i.
|
inline |
Return the attribute list for this Function.
Definition at line 239 of file Function.h.
Referenced by addAttribute(), addAttributes(), llvm::Argument::addAttrs(), addDereferenceableAttr(), addDereferenceableOrNullAttr(), addDereferenceableOrNullParamAttr(), addDereferenceableParamAttr(), addParamAttr(), addParamAttrs(), llvm::TargetLowering::BuildSDIVPow2(), llvm::CloneFunctionInto(), llvm::FunctionComparator::compareSignature(), copyAttributesFrom(), llvm::XCoreFrameLowering::emitPrologue(), fillOverallFunction(), llvm::AArch64RegisterInfo::getCalleeSavedRegs(), llvm::SystemZRegisterInfo::getCalleeSavedRegs(), llvm::AArch64RegisterInfo::getCallPreservedMask(), llvm::SystemZRegisterInfo::getCallPreservedMask(), llvm::ARMBaseRegisterInfo::getCallPreservedMask(), llvm::AArch64RegisterInfo::getDarwinCalleeSavedRegs(), llvm::AArch64RegisterInfo::getDarwinCallPreservedMask(), getMemcpyLoadsAndStores(), getMemmoveLoadsAndStores(), getMemsetStores(), getParamAttribute(), llvm::Argument::getPassPointeeByValueCopySize(), llvm::Argument::getPointeeInMemoryValueType(), hasAttribute(), hasParamAttribute(), llvm::Argument::hasPassPointeeByValueCopyAttr(), llvm::Argument::hasPointeeInMemoryValueAttr(), insertSinCosCall(), IsCallReturnTwice(), llvm::PPCInstrInfo::isSignOrZeroExtended(), llvm::Attributor::isValidFunctionSignatureRewrite(), llvm::IRAttributeManifest::manifestAttrs(), llvm::Argument::onlyReadsMemory(), optimizeDoubleFP(), produceCompactUnwindFrame(), removeAttribute(), removeAttributes(), llvm::IRPosition::removeAttrs(), removeFnAttr(), removeParamAttr(), removeParamAttrs(), llvm::TargetLoweringObjectFile::SectionForGlobal(), llvm::FunctionLoweringInfo::set(), llvm::CallLowering::setArgFlags(), llvm::TargetLowering::SimplifySetCC(), and llvm::InstCombinerImpl::visitFDiv().
|
inline |
Definition at line 725 of file Function.h.
|
inline |
Get the underlying elements of the Function...
the basic block list is empty for external functions.
Definition at line 724 of file Function.h.
Referenced by llvm::CloneAndPruneIntoFromInst(), doPromotion(), llvm::BasicBlock::eraseFromParent(), llvm::BasicBlock::insertInto(), LLVMInsertExistingBasicBlockAfterInsertBlock(), llvm::BasicBlock::moveAfter(), llvm::BasicBlock::moveBefore(), llvm::BasicBlock::removeFromParent(), llvm::UnrollAndJamLoop(), and llvm::UnrollLoop().
|
inline |
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this function.
The enum values for the known calling conventions are defined in CallingConv.h.
Definition at line 228 of file Function.h.
References llvm::Value::getSubclassDataFromValue(), and llvm::CallingConv::MaxID.
Referenced by llvm::SIMachineFunctionInfo::allocateVGPRSpillToAGPR(), llvm::AMDGPUTargetLowering::analyzeFormalArgumentsCompute(), llvm::AVRMachineFunctionInfo::AVRMachineFunctionInfo(), llvm::FunctionComparator::compareSignature(), computeCalleeSaveRegisterPairs(), llvm::computeSignatureVTs(), copyAttributesFrom(), llvm::coro::createMustTailCall(), llvm::AArch64FrameLowering::determineCalleeSaves(), llvm::ARMFrameLowering::emitEpilogue(), llvm::RISCVFrameLowering::emitEpilogue(), llvm::AArch64FrameLowering::emitEpilogue(), llvm::SystemZFrameLowering::emitEpilogue(), llvm::PPCFrameLowering::emitEpilogue(), llvm::RISCVFrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), llvm::AArch64FrameLowering::emitPrologue(), llvm::SystemZFrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), llvm::X86FrameLowering::enableShrinkWrapping(), llvm::VERegisterInfo::getCalleeSavedRegs(), llvm::RISCVRegisterInfo::getCalleeSavedRegs(), llvm::AArch64RegisterInfo::getCalleeSavedRegs(), llvm::SIRegisterInfo::getCalleeSavedRegs(), llvm::SystemZRegisterInfo::getCalleeSavedRegs(), llvm::PPCRegisterInfo::getCalleeSavedRegs(), llvm::AArch64RegisterInfo::getCalleeSavedRegsViaCopy(), llvm::X86RegisterInfo::getCalleeSavedRegsViaCopy(), llvm::ARMBaseRegisterInfo::getCalleeSavedRegsViaCopy(), llvm::AArch64RegisterInfo::getDarwinCalleeSavedRegs(), llvm::SIInstrInfo::getDSShaderTypeValue(), getFPOffset(), llvm::X86FrameLowering::getFrameIndexReference(), llvm::SIMachineFunctionInfo::getGITPtrLoReg(), llvm::Mangler::getNameWithPrefix(), llvm::X86RegisterInfo::getReservedRegs(), GetScratchRegister(), llvm::TargetFrameLowering::getStackAlignmentSkew(), llvm::X86FrameLowering::has128ByteRedZone(), llvm::InlineFunction(), isCallableFunction(), llvm::TargetRegisterInfo::isCalleeSavedPhysReg(), llvm::AArch64CallLowering::isEligibleForTailCallOptimization(), llvm::HexagonTargetLowering::IsEligibleForTailCallOptimization(), llvm::SITargetLowering::isEligibleForTailCallOptimization(), llvm::SIInstrInfo::legalizeOperands(), llvm::SITargetLowering::LowerCall(), LowerVACOPY(), llvm::SITargetLowering::mayBeEmittedAsTailCall(), reservePrivateMemoryRegs(), llvm::AArch64FrameLowering::resolveFrameOffsetReference(), llvm::FunctionLoweringInfo::set(), llvm::AArch64TargetLowering::supportSplitCSR(), llvm::SystemZFrameLowering::usePackedStack(), llvm::R600InstrInfo::usesTextureCache(), and llvm::R600InstrInfo::usesVertexCache().
LLVMContext & Function::getContext | ( | ) | const |
getContext - Return a reference to the LLVMContext associated with this function.
Definition at line 300 of file Function.cpp.
References llvm::Type::getContext(), and llvm::GlobalValue::getType().
Referenced by AddAliasScopeMetadata(), addAttribute(), llvm::OpenMPIRBuilder::addAttributes(), addAttributes(), llvm::Argument::addAttrs(), addBoundsChecking(), addDereferenceableAttr(), addDereferenceableOrNullAttr(), addDereferenceableOrNullParamAttr(), addDereferenceableParamAttr(), addFnAttr(), addParamAttr(), addParamAttrs(), llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::MachineOptimizationRemarkEmitter::allowExtraAnalysis(), llvm::CombinerHelper::applyCombineConstantFoldFpUnary(), llvm::MachineIRBuilder::buildFConstant(), clearGC(), llvm::CloneFunctionInto(), collectCallSiteParameters(), llvm::SITargetLowering::computeKnownAlignForTargetInstr(), convertImplicitDefToConstZero(), createFPFnStub(), llvm::createMemLibcall(), llvm::TargetInstrInfo::describeLoadedValue(), duplicateCPV(), llvm::OptimizationRemarkEmitter::emit(), llvm::MachineOptimizationRemarkEmitter::emit(), llvm::ARMBaseRegisterInfo::emitLoadConstPool(), llvm::RISCVFrameLowering::emitPrologue(), emitSCSEpilogue(), emitSCSPrologue(), emitThumb1LoadConstPool(), emitThumb2LoadConstPool(), llvm::FastISel::fastEmit_ri_(), fixupDebugInfoPostExtraction(), fixupLineNumbers(), llvm::X86InstrInfo::foldMemoryOperandImpl(), getDefaultInlineAdvice(), getFunctionTypeFromAsyncSuspend(), getGC(), llvm::OpenMPIRBuilder::getOrCreateRuntimeFunction(), getRegistersForValue(), llvm::FunctionLoweringInfo::getValueFromVirtualReg(), llvm::SelectionDAG::init(), interpretValues(), llvm::MachineOptimizationRemark::isEnabled(), llvm::MachineOptimizationRemarkMissed::isEnabled(), llvm::MachineOptimizationRemarkAnalysis::isEnabled(), llvm::OptimizationRemark::isEnabled(), llvm::OptimizationRemarkMissed::isEnabled(), llvm::OptimizationRemarkAnalysis::isEnabled(), llvm::PPCTargetLowering::isFMAFasterThanFMulAndFAdd(), llvm::ARMLegalizerInfo::legalizeCustom(), llvm::AMDGPULegalizerInfo::legalizeGlobalValue(), llvm::LegalizerHelper::libcall(), llvm::XCoreInstrInfo::loadImmediate(), llvm::RISCVTargetLowering::LowerCall(), llvm::lowerObjectSizeCall(), llvm::RISCVTargetLowering::LowerReturn(), llvm::CombinerHelper::matchLoadOrCombine(), llvm::MIPrinter::print(), llvm::MachineInstr::print(), removeAttribute(), removeAttributes(), removeFnAttr(), removeParamAttr(), removeParamAttrs(), replaceAsyncResumeFunction(), reportIllegalCopy(), llvm::ExecutionEngine::runFunctionAsMain(), llvm::OptimizationRemarkEmitterWrapperPass::runOnFunction(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::MachineOptimizationRemarkEmitterPass::runOnMachineFunction(), llvm::coro::salvageDebugInfo(), llvm::FunctionLoweringInfo::set(), setEntryCount(), setGC(), setSectionPrefix(), and llvm::LegalizerHelper::widenScalar().
DenormalMode Function::getDenormalMode | ( | const fltSemantics & | FPType | ) | const |
Returns the denormal handling type for the default rounding mode of the function.
Definition at line 585 of file Function.cpp.
References llvm::StringRef::empty(), getFnAttribute(), llvm::Attribute::getValueAsString(), llvm::APFloatBase::IEEEsingle(), and llvm::parseDenormalFPAttribute().
Referenced by fpModeMatchesGlobalFPAtomicMode(), and llvm::MachineFunction::getDenormalMode().
|
inline |
Extract the number of dereferenceable bytes for a call or parameter (0=unknown).
i | AttributeList index, referring to a return value or argument. |
Definition at line 500 of file Function.h.
References llvm::AttributeList::getDereferenceableBytes(), and i.
|
inline |
Extract the number of dereferenceable_or_null bytes for a call or parameter (0=unknown).
i | AttributeList index, referring to a return value or argument. |
Definition at line 513 of file Function.h.
References llvm::AttributeList::getDereferenceableOrNullBytes(), and i.
|
inline |
Definition at line 732 of file Function.h.
References front().
|
inline |
Definition at line 731 of file Function.h.
References front().
Referenced by calculateStateNumbersForInvokes(), llvm::CloneAndPruneIntoFromInst(), llvm::FunctionComparator::compare(), llvm::createSanitizerCtorAndInitFunctions(), cxxDtorIsEmpty(), llvm::OpenMPIRBuilder::finalize(), findArgumentCopyElisionCandidates(), llvm::MemoryDependenceResults::getDependency(), llvm::GraphTraits< DOTFuncInfo * >::getEntryNode(), llvm::GraphTraits< DOTFuncMSSAInfo * >::getEntryNode(), isColdCallSite(), llvm::SelectionDAGBuilder::isExportableFromCurrentBlock(), llvm::PPCInstrInfo::isSignOrZeroExtended(), memoryIsNotModifiedBetween(), llvm::MergeBasicBlockIntoOnlyPred(), NegateValue(), UpdateAnalysisInformation(), and llvm::InstCombinerImpl::visitAllocaInst().
ProfileCount Function::getEntryCount | ( | bool | AllowSynthetic = false | ) | const |
Get the entry count for this function.
Entry count is the number of times the function was executed. When AllowSynthetic is false, only pgo_data will be returned.
Definition at line 1752 of file Function.cpp.
References llvm::Function::ProfileCount::getInvalid(), llvm::Value::getMetadata(), llvm::MDNode::getOperand(), llvm::ConstantInt::getValue(), llvm::APInt::getZExtValue(), PCT_Real, and PCT_Synthetic.
Referenced by hasProfileData(), llvm::InlineFunction(), and setEntryCount().
|
inline |
Return the attribute for the given attribute kind.
Definition at line 355 of file Function.h.
References llvm::AttributeList::FunctionIndex, and getAttribute().
Referenced by llvm::TargetLoweringBase::areJTsAllowed(), getDenormalMode(), llvm::SystemZTargetLowering::getStackProbeSize(), llvm::PPCTargetLowering::getStackProbeSize(), llvm::X86TargetLowering::getStackProbeSize(), llvm::X86TargetLowering::getStackProbeSymbolName(), llvm::SystemZTargetLowering::hasInlineStackProbe(), llvm::PPCTargetLowering::hasInlineStackProbe(), llvm::X86TargetLowering::hasInlineStackProbe(), StrBoolAttr::isSet(), llvm::CallLowering::lowerCall(), llvm::RISCVTargetLowering::LowerFormalArguments(), llvm::RISCVTargetLowering::LowerReturn(), llvm::StackProtector::runOnFunction(), llvm::SITargetLowering::shouldExpandAtomicRMWInIR(), simplifyNvvmIntrinsic(), and SwitchToLookupTable().
Return the attribute for the given attribute kind.
Definition at line 360 of file Function.h.
References llvm::AttributeList::FunctionIndex, and getAttribute().
|
inline |
Return the stack alignment for the function.
Definition at line 375 of file Function.h.
References llvm::AttributeList::FunctionIndex, llvm::AttributeList::getStackAlignment(), hasFnAttribute(), and llvm::None.
|
inline |
Return the stack alignment for the function.
Definition at line 365 of file Function.h.
References llvm::AttributeList::FunctionIndex, llvm::AttributeList::getStackAlignment(), and hasFnAttribute().
Definition at line 135 of file Function.h.
|
inline |
Returns the FunctionType for me.
Definition at line 165 of file Function.h.
References llvm::GlobalValue::getValueType().
Referenced by llvm::FunctionComparator::compareSignature(), llvm::MatrixBuilder< IRBuilderTy >::CreateColumnMajorLoad(), llvm::MatrixBuilder< IRBuilderTy >::CreateColumnMajorStore(), llvm::IRBuilderBase::CreateLaunderInvariantGroup(), llvm::MatrixBuilder< IRBuilderTy >::CreateMatrixMultiply(), llvm::MatrixBuilder< IRBuilderTy >::CreateMatrixTranspose(), llvm::IRBuilderBase::CreateStripInvariantGroup(), llvm::ARMTargetLowering::emitStoreConditional(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::TargetLibraryInfoImpl::getLibFunc(), llvm::Mangler::getNameWithPrefix(), llvm::OpenMPIRBuilder::getOrCreateRuntimeFunction(), llvm::coro::Shape::getRetconResultTypes(), getReturnType(), llvm::LoopVectorizationCostModel::getVectorIntrinsicCost(), llvm::InlineFunction(), llvm::IntrinsicCostAttributes::IntrinsicCostAttributes(), isVarArg(), llvm::HexagonTargetLowering::LowerFormalArguments(), llvm::SITargetLowering::LowerFormalArguments(), llvm::DiagnosticInfoUnsupported::print(), replaceCalledFunction(), replaceWithTLIFunction(), llvm::ExecutionEngine::runFunctionAsMain(), llvm::CallBase::setCalledFunction(), and llvm::UpgradeARCRuntime().
const std::string & Function::getGC | ( | ) | const |
Definition at line 600 of file Function.cpp.
References assert(), getContext(), llvm::LLVMContext::getGC(), and hasGC().
Referenced by llvm::FunctionComparator::compareSignature(), copyAttributesFrom(), and llvm::InlineFunction().
DenseSet< GlobalValue::GUID > Function::getImportGUIDs | ( | ) | const |
Returns the set of GUIDs that needs to be imported to the function for sample PGO, to enable the same inlines as the profiled optimized binary.
Definition at line 1774 of file Function.cpp.
References llvm::Value::getMetadata(), and i.
Referenced by setEntryCount().
unsigned Function::getInstructionCount | ( | ) | const |
Returns the number of non-debug IR instructions in this function.
This is equivalent to the sum of the sizes of each basic block contained within this function.
Definition at line 304 of file Function.cpp.
References BB.
|
inline |
getIntrinsicID - This method returns the ID number of the specified function, or Intrinsic::not_intrinsic if the function is not an intrinsic, or if the pointer is null.
This value is always defined to be zero to allow easy checking for whether a function is intrinsic or not. The particular intrinsic functions which correspond to this value are defined in llvm/Intrinsics.h.
Definition at line 195 of file Function.h.
References llvm::GlobalValue::IntID.
Referenced by addIntrinsicToSummary(), llvm::findDevirtualizableCallsForTypeCheckedLoad(), llvm::findDevirtualizableCallsForTypeTest(), FindPreallocatedCall(), llvm::IntrinsicInst::getIntrinsicID(), handleBrSelExpect(), handlePhiDef(), handleSwitchExpect(), hasOnlyColdCalls(), isConstrainedFPIntrinsic(), lowerExpectIntrinsic(), optimizeDoubleFP(), and replaceWithCallToVeclib().
|
inline |
Definition at line 478 of file Function.h.
References llvm::AttributeList::getParamAlignment().
Referenced by getFrameLayout(), llvm::Argument::getParamAlign(), and getParamAlignment().
|
inline |
Extract the alignment for a call or parameter (0=unknown).
FIXME: Remove this function once transition to Align is over. Use getParamAlign() instead.
Definition at line 472 of file Function.h.
References getParamAlign().
Referenced by llvm::Argument::getParamAlignment(), getParameterABIAttributes(), and llvm::InlineFunction().
|
inline |
gets the specified attribute from the list of attributes.
Definition at line 440 of file Function.h.
References getAttributes(), and llvm::AttributeList::getParamAttr().
Referenced by llvm::Argument::getAttribute().
|
inline |
Extract the byref type for a parameter.
Definition at line 493 of file Function.h.
References llvm::AttributeList::getParamByRefType().
Referenced by llvm::Argument::getParamByRefType().
|
inline |
Extract the byval type for a parameter.
Definition at line 483 of file Function.h.
References llvm::AttributeList::getParamByValType().
Referenced by llvm::Argument::getParamByValType().
|
inline |
Extract the number of dereferenceable bytes for a parameter.
ArgNo | Index of an argument, with 0 being the first function arg. |
Definition at line 506 of file Function.h.
References llvm::AttributeList::getParamDereferenceableBytes().
Referenced by llvm::Argument::getDereferenceableBytes(), and getFrameLayout().
|
inline |
Extract the number of dereferenceable_or_null bytes for a parameter.
ArgNo | AttributeList ArgNo, referring to an argument. |
Definition at line 520 of file Function.h.
References llvm::AttributeList::getParamDereferenceableOrNullBytes().
Referenced by llvm::Argument::getDereferenceableOrNullBytes().
|
inline |
Extract the sret type for a parameter.
Definition at line 488 of file Function.h.
References llvm::AttributeList::getParamStructRetType().
Referenced by llvm::Argument::getParamStructRetType().
Constant * Function::getPersonalityFn | ( | ) | const |
Get the personality function associated with this function.
Definition at line 1665 of file Function.cpp.
References assert(), llvm::User::getNumOperands(), and hasPersonalityFn().
Referenced by llvm::CodeViewDebug::beginFunctionImpl(), llvm::CloneFunctionInto(), llvm::LoopSafetyInfo::computeBlockColors(), copyAttributesFrom(), llvm::XCoreFrameLowering::emitEpilogue(), llvm::XCoreFrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), findUnwindDestinations(), llvm::getEHScopeMembership(), getSEHRegistrationNodeSize(), llvm::InlineFunction(), llvm::SelectionDAGBuilder::lowerInvokable(), needFuncLabelsForEHOrDebugInfo(), llvm::X86FrameLowering::processFunctionBeforeFrameFinalized(), llvm::X86FrameLowering::restoreWinEHStackPointersInParent(), llvm::StackProtector::runOnFunction(), llvm::FunctionLoweringInfo::set(), and llvm::InstCombinerImpl::visitLandingPadInst().
Constant * Function::getPrefixData | ( | ) | const |
Get the prefix data associated with this function.
Definition at line 1675 of file Function.cpp.
References assert(), llvm::User::getNumOperands(), and hasPrefixData().
Referenced by copyAttributesFrom().
Constant * Function::getPrologueData | ( | ) | const |
Get the prologue data associated with this function.
Definition at line 1685 of file Function.cpp.
References assert(), llvm::User::getNumOperands(), and hasPrologueData().
Referenced by copyAttributesFrom().
|
inline |
Returns the type of the ret val.
Definition at line 170 of file Function.h.
References getFunctionType(), and llvm::FunctionType::getReturnType().
Referenced by assureFPCallStub(), copyMustTailReturn(), llvm::IRBuilderBase::CreateLaunderInvariantGroup(), llvm::IRBuilderBase::CreateStripInvariantGroup(), llvm::OpenMPIRBuilder::finalize(), llvm::IRPosition::getAssociatedType(), llvm::IRBuilderBase::getCurrentFunctionReturnType(), llvm::InlineFunction(), llvm::PPCInstrInfo::isSignOrZeroExtended(), llvm::Attributor::isValidFunctionSignatureRewrite(), llvm::NVPTXTargetLowering::LowerReturn(), llvm::makeGuardControlFlowExplicit(), and llvm::FunctionLoweringInfo::set().
Get the section prefix for this function.
Definition at line 1792 of file Function.cpp.
References assert(), llvm::Value::getMetadata(), and llvm::None.
|
inlinestatic |
Definition at line 727 of file Function.h.
DISubprogram * Function::getSubprogram | ( | ) | const |
Get the attached subprogram.
Calls getMetadata() with LLVMContext::MD_dbg and casts the result to DISubprogram.
Definition at line 1513 of file Metadata.cpp.
References llvm::Value::getMetadata().
Referenced by llvm::BTFDebug::beginFunctionImpl(), llvm::DwarfDebug::beginFunctionImpl(), llvm::DwarfDebug::beginInstruction(), llvm::CloneFunctionInto(), llvm::Instruction::dropLocation(), llvm::AsmPrinter::emitFunctionBody(), llvm::DwarfDebug::emitInitialLocDirective(), llvm::CodeViewDebug::endFunctionImpl(), llvm::DwarfDebug::endFunctionImpl(), fixupDebugInfoPostExtraction(), hasDebugInfo(), llvm::LexicalScopes::initialize(), llvm::InlineFunction(), isDebugInfoForProfiling(), and llvm::Legalizer::runOnMachineFunction().
|
inline |
getSymbolTable() - Return the symbol table if any, otherwise nullptr.
Definition at line 739 of file Function.h.
Referenced by parseIRValue().
|
inline |
Definition at line 740 of file Function.h.
bool Function::hasAddressTaken | ( | const User ** | PutOffender = nullptr , |
bool | IgnoreCallbackUses = false , |
||
bool | IgnoreAssumeLikeCalls = false , |
||
bool | IgnoreLLVMUsed = false |
||
) | const |
hasAddressTaken - returns true if there are any uses of this function other than direct calls or invokes to it, or blockaddress expressions.
hasAddressTaken - returns true if there are any uses of this function other than direct calls or invokes to it.
Optionally passes back an offending user for diagnostic purposes, ignores callback uses, assume like pointer annotation calls, and references in llvm.used and llvm.compiler.used variables.
Optionally ignores callback uses, assume like pointer annotation calls, and references in llvm.used and llvm.compiler.used variables.
Definition at line 1585 of file Function.cpp.
References llvm::all_of(), llvm::Value::hasOneUse(), llvm::AbstractCallSite::isCallbackCall(), llvm::Value::user_begin(), llvm::Value::user_empty(), llvm::Value::users(), and llvm::Value::uses().
Referenced by hasOnlyColdCalls().
|
inline |
check if an attributes is in the list of attributes.
Definition at line 430 of file Function.h.
References getAttributes(), llvm::AttributeList::hasAttribute(), and i.
Referenced by llvm::CallLowering::addArgFlagsFromAttributes(), addIfNotExistent(), llvm::TargetLoweringObjectFileELF::getExplicitSectionGlobal(), llvm::PPCInstrInfo::isSignOrZeroExtended(), and llvm::TargetLoweringObjectFile::SectionForGlobal().
|
inline |
Return true if the function has the attribute.
Definition at line 345 of file Function.h.
References llvm::AttributeList::hasFnAttribute().
Referenced by llvm::AArch64FunctionInfo::AArch64FunctionInfo(), llvm::AVRMachineFunctionInfo::AVRMachineFunctionInfo(), llvm::CodeViewDebug::beginFunctionImpl(), llvm::AArch64TargetLowering::canMergeStoresTo(), llvm::X86TargetLowering::canMergeStoresTo(), cannotDuplicate(), llvm::TargetRegisterInfo::canRealignStack(), canTransformToMemCmp(), checkNumAlignedDPRCS2Regs(), computeCalleeSaveRegisterPairs(), llvm::RISCVFrameLowering::determineCalleeSaves(), llvm::TargetFrameLowering::determineCalleeSaves(), llvm::PPCFrameLowering::determineFrameLayout(), doesNoCfCheck(), doesNotAccessMemory(), doesNotFreeMemory(), doesNotReadMemory(), doesNotRecurse(), doesNotReturn(), doesNotThrow(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::MipsSEFrameLowering::emitEpilogue(), llvm::MipsAsmPrinter::emitFunctionBodyStart(), llvm::MipsSEFrameLowering::emitPrologue(), llvm::SystemZFrameLowering::emitPrologue(), emitSCSEpilogue(), emitSCSPrologue(), llvm::ARMFrameLowering::enableCalleeSaveSkip(), llvm::TargetFrameLowering::enableCalleeSaveSkip(), llvm::X86FrameLowering::enableShrinkWrapping(), fixupLineNumbers(), llvm::RISCVRegisterInfo::getCalleeSavedRegs(), llvm::X86RegisterInfo::getCalleeSavedRegs(), llvm::AArch64RegisterInfo::getCallPreservedMask(), getFnStackAlign(), getFnStackAlignment(), llvm::AArch64FrameLowering::getFrameIndexReference(), llvm::VNCoercion::getLoadLoadClobberFullWidthSize(), llvm::Attributor::getOrCreateAAFor(), llvm::SystemZFrameLowering::getRegSpillOffset(), llvm::MipsRegisterInfo::getReservedRegs(), llvm::AArch64RegisterInfo::getReservedRegs(), llvm::SystemZTargetLowering::getStackProbeSize(), llvm::PPCTargetLowering::getStackProbeSize(), llvm::X86TargetLowering::getStackProbeSize(), llvm::X86TargetLowering::getStackProbeSymbolName(), llvm::X86FrameLowering::has128ByteRedZone(), llvm::HexagonFrameLowering::hasFP(), llvm::SystemZTargetLowering::hasInlineStackProbe(), llvm::PPCTargetLowering::hasInlineStackProbe(), llvm::X86TargetLowering::hasInlineStackProbe(), hasMinSize(), hasOptNone(), hasOptSize(), hasReturnsTwiceAttr(), hasStackProtectorFnAttr(), hasUWTable(), llvm::SystemZFrameLowering::inlineStackProbe(), IsCallReturnTwice(), isConvergent(), isNoReturnDef(), isPresplitCoroutine(), EnumAttr::isSet(), isSpeculatable(), maybeEndlessLoop(), mustProgress(), llvm::PPCFrameLowering::needsFP(), nullPointerIsDefined(), onlyAccessesArgMemory(), onlyAccessesInaccessibleMemOrArgMem(), onlyAccessesInaccessibleMemory(), onlyReadsMemory(), performBRCONDCombine(), llvm::SystemZFrameLowering::processFunctionBeforeFrameFinalized(), llvm::X86TargetLowering::ReplaceNodeResults(), llvm::PPCFrameLowering::restoreCalleeSavedRegisters(), llvm::MachineFunction::shouldSplitStack(), llvm::AArch64FrameLowering::spillCalleeSavedRegisters(), llvm::PPCFrameLowering::spillCalleeSavedRegisters(), llvm::AArch64TargetLowering::supportSplitCSR(), llvm::SystemZFrameLowering::usePackedStack(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitFree(), and willReturn().
|
inline |
Return true if the function has the attribute.
Definition at line 350 of file Function.h.
References llvm::AttributeList::hasFnAttribute().
|
inline |
hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm to use during code generation.
Definition at line 383 of file Function.h.
References llvm::Value::getSubclassDataFromValue().
Referenced by clearGC(), llvm::FunctionComparator::compareSignature(), copyAttributesFrom(), getGC(), llvm::InlineFunction(), and llvm::SelectionDAGISel::runOnMachineFunction().
|
inline |
hasLazyArguments/CheckLazyArguments - The argument list of a function is built on demand, so that the list isn't allocated until the first client needs it.
The hasLazyArguments predicate returns true if the arg list hasn't been set up yet.
Definition at line 106 of file Function.h.
References llvm::Value::getSubclassDataFromValue().
Referenced by stealArgumentListFrom().
|
inline |
Optimize this function for minimum size (-Oz).
Definition at line 682 of file Function.h.
References hasFnAttribute().
Referenced by analyzeLoopUnrollCost(), combineFMinNumFMaxNum(), combineMul(), EmitCmp(), emitConstantSizeRepmov(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::ARMSubtarget::getGPRAllocationOrder(), hasOptSize(), llvm::ARMSubtarget::ignoreCSRForAllocationOrder(), isMinSize(), llvm::ARMBaseInstrInfo::isProfitableToIfCvt(), reduceVMULWidth(), llvm::RISCVTargetLowering::shouldExpandShift(), llvm::AArch64TargetLowering::shouldExpandShift(), llvm::X86TargetLowering::shouldExpandShift(), shouldLowerMemFuncForSize(), llvm::AArch64InstrInfo::shouldOutlineFromFunctionByDefault(), llvm::ARMBaseInstrInfo::shouldOutlineFromFunctionByDefault(), splitStores(), and unswitchBestCondition().
|
inline |
Do not optimize this function (-O0).
Definition at line 679 of file Function.h.
References hasFnAttribute().
Referenced by llvm::CodeViewDebug::beginFunctionImpl(), and isOptNone().
|
inline |
Optimize this function for size (-Os) or minimum size (-Oz).
Definition at line 685 of file Function.h.
References hasFnAttribute(), and hasMinSize().
Referenced by AlignBlocks(), llvm::CodeViewDebug::beginFunctionImpl(), combineFMA(), combineFMADDSUB(), combineFneg(), llvm::InnerLoopVectorizer::emitMemRuntimeChecks(), llvm::InnerLoopVectorizer::emitSCEVChecks(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::gatherUnrollingPreferences(), llvm::ARMTTIImpl::getPreferredAddressingMode(), llvm::ARMTTIImpl::getUnrollingPreferences(), llvm::ARMBaseInstrInfo::isProfitableToIfCvt(), ProfitableToMerge(), shouldLowerMemFuncForSize(), llvm::FastISel::shouldOptForSize(), llvm::SelectionDAG::shouldOptForSize(), llvm::TailDuplicator::shouldTailDuplicate(), tryToUnrollLoop(), and unswitchLoop().
|
inline |
check if an attributes is in the list of attributes.
Definition at line 435 of file Function.h.
References getAttributes(), and llvm::AttributeList::hasParamAttribute().
Referenced by getParameterABIAttributes(), llvm::Argument::hasAttribute(), llvm::Argument::hasPassPointeeByValueCopyAttr(), llvm::Argument::hasPointeeInMemoryValueAttr(), llvm::Argument::hasSwiftErrorAttr(), llvm::Argument::hasSwiftSelfAttr(), llvm::Argument::onlyReadsMemory(), and shouldBeMustTail().
|
inline |
Check whether this function has a personality function.
Definition at line 799 of file Function.h.
References llvm::Value::getSubclassDataFromValue().
Referenced by llvm::CodeViewDebug::beginFunctionImpl(), llvm::CloneFunctionInto(), llvm::LoopSafetyInfo::computeBlockColors(), copyAttributesFrom(), llvm::XCoreFrameLowering::emitEpilogue(), llvm::XCoreFrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), getPersonalityFn(), getSEHRegistrationNodeSize(), llvm::InlineFunction(), needFuncLabelsForEHOrDebugInfo(), llvm::WebAssemblyFrameLowering::needsPrologForEH(), needsUnwindTableEntry(), recoverFramePointer(), llvm::StackProtector::runOnFunction(), and llvm::FunctionLoweringInfo::set().
|
inline |
Check whether this function has prefix data.
Definition at line 808 of file Function.h.
References llvm::Value::getSubclassDataFromValue().
Referenced by copyAttributesFrom(), and getPrefixData().
|
inline |
Return true if the function is annotated with profile data.
Presence of entry counts from a profile run implies the function has profile annotations. If IncludeSynthetic is false, only return true when the profile data is real.
Definition at line 330 of file Function.h.
References getEntryCount(), and llvm::Function::ProfileCount::hasValue().
Referenced by llvm::computePeelCount(), llvm::computeUnrollCount(), llvm::ProfileSummaryInfo::isColdCallSite(), llvm::LoopSinkPass::run(), sinkLoopInvariantInstructions(), and worthSinkOrHoistInst().
|
inline |
Check whether this function has prologue data.
Definition at line 817 of file Function.h.
References llvm::Value::getSubclassDataFromValue().
Referenced by copyAttributesFrom(), and getPrologueData().
bool Function::hasStackProtectorFnAttr | ( | ) | const |
Returns true if the function has ssp, sspstrong, or sspreq fn attrs.
Definition at line 617 of file Function.cpp.
References hasFnAttribute().
|
inline |
Determine if the function returns a structure through first or second pointer argument.
Definition at line 663 of file Function.h.
References llvm::AttributeList::hasParamAttribute().
Referenced by llvm::Mangler::getNameWithPrefix(), llvm::HexagonTargetLowering::LowerCall(), llvm::SparcTargetLowering::LowerFormalArguments_32(), and llvm::SparcTargetLowering::LowerReturn_32().
|
inline |
True if the ABI mandates (or the user requested) that this function be in a unwind table.
Definition at line 649 of file Function.h.
References hasFnAttribute().
Referenced by needsUnwindTableEntry().
bool Function::isConstrainedFPIntrinsic | ( | ) | const |
Returns true if the function is one of the "Constrained Floating-Point Intrinsics".
Returns false if not, and returns false when getIntrinsicID() returns Intrinsic::not_intrinsic.
Definition at line 400 of file Function.cpp.
References getIntrinsicID().
|
inline |
Determine if the call is convergent.
Definition at line 601 of file Function.h.
References llvm::MCID::Convergent, and hasFnAttribute().
bool Function::isDebugInfoForProfiling | ( | ) | const |
Returns true if we should emit debug info for profiling.
Definition at line 1517 of file Metadata.cpp.
References getSubprogram().
Referenced by llvm::UnrollAndJamLoop(), and llvm::UnrollLoop().
bool Function::isDefTriviallyDead | ( | ) | const |
isDefTriviallyDead - Return true if it is trivially safe to remove this function definition from the module (because it isn't externally visible, does not have its address taken, and has no callers).
To make this more accurate, call removeDeadConstantUsers first.
Definition at line 1640 of file Function.cpp.
References llvm::GlobalValue::hasAvailableExternallyLinkage(), llvm::GlobalValue::hasLinkOnceLinkage(), llvm::GlobalValue::hasLocalLinkage(), and llvm::Value::users().
|
inline |
isIntrinsic - Returns true if the function's name starts with "llvm.".
It's possible for this function to return true while getIntrinsicID() returns Intrinsic::not_intrinsic!
Definition at line 200 of file Function.h.
References llvm::GlobalValue::HasLLVMReservedName.
Referenced by llvm::CloneAndPruneIntoFromInst(), llvm::TargetLibraryInfoImpl::getLibFunc(), and optimizeDoubleFP().
|
inline |
Definition at line 180 of file Function.h.
References llvm::GlobalObject::getGlobalObjectSubClassData().
|
inline |
A function will have the "coroutine.presplit" attribute if it's a coroutine and has not gone through full CoroSplit pass.
Definition at line 273 of file Function.h.
References hasFnAttribute().
|
inline |
Determine if the call has sideeffects.
Definition at line 612 of file Function.h.
References hasFnAttribute().
bool Function::isTargetIntrinsic | ( | ) | const |
isTargetIntrinsic - Returns true if this function is an intrinsic and the intrinsic is specific to a certain target.
If this is not an intrinsic or a generic intrinsic, false is returned.
Definition at line 658 of file Function.cpp.
References llvm::GlobalValue::IntID.
Referenced by llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getIntrinsicInstrCost().
|
static |
isTargetIntrinsic - Returns true if IID is an intrinsic specific to a certain target.
If it is a generic intrinsic false is returned.
Definition at line 654 of file Function.cpp.
Referenced by llvm::InstCombiner::targetInstCombineIntrinsic(), llvm::InstCombiner::targetSimplifyDemandedUseBitsIntrinsic(), and llvm::InstCombiner::targetSimplifyDemandedVectorEltsIntrinsic().
|
inline |
isVarArg - Return true if this function takes a variable number of arguments.
Definition at line 178 of file Function.h.
References getFunctionType(), and llvm::FunctionType::isVarArg().
Referenced by llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::X86FrameLowering::adjustForSegmentedStacks(), llvm::SystemZFrameLowering::assignCalleeSavedSpillSlots(), llvm::FunctionComparator::compareSignature(), llvm::XCoreFunctionInfo::createLRSpillSlot(), llvm::SystemZFrameLowering::determineCalleeSaves(), llvm::XCoreFrameLowering::determineCalleeSaves(), llvm::ARCFrameLowering::emitEpilogue(), llvm::ARCFrameLowering::emitPrologue(), llvm::SystemZFrameLowering::getRegSpillOffset(), hasOnlyColdCalls(), llvm::Attributor::isValidFunctionSignatureRewrite(), llvm::FunctionLoweringInfo::set(), and llvm::SystemZFrameLowering::spillCalleeSavedRegisters().
|
static |
This does the actual lookup of an intrinsic ID which matches the given function name.
Definition at line 683 of file Function.cpp.
References assert(), llvm::ArrayRef< T >::data(), findTargetSubtable(), IntrinsicNameTable, llvm::Intrinsic::isOverloaded(), llvm::Intrinsic::lookupLLVMIntrinsicByName(), and llvm::Intrinsic::not_intrinsic.
Referenced by LLVMLookupIntrinsicID(), and recalculateIntrinsicID().
|
inline |
Determine if the function is required to make forward progress.
Definition at line 637 of file Function.h.
References hasFnAttribute().
Referenced by deleteLoopIfDead(), and hasPartialIVCondition().
|
inline |
True if this function needs an unwind table.
Definition at line 657 of file Function.h.
References doesNotThrow(), hasPersonalityFn(), and hasUWTable().
Referenced by llvm::X86FrameLowering::emitEpilogue(), llvm::X86FrameLowering::emitPrologue(), llvm::ARMException::endFunction(), llvm::AsmPrinter::needsCFIMoves(), llvm::MachineFunction::needsFrameMoves(), llvm::AsmPrinter::needsSEHMoves(), and needsWinCFI().
bool Function::nullPointerIsDefined | ( | ) | const |
Check if null pointer dereferencing is considered undefined behavior for the function.
Return value: false => null pointer dereference is undefined. Return value: true => null pointer dereference is not undefined.
Definition at line 1803 of file Function.cpp.
References hasFnAttribute().
|
inline |
Determine if the call can access memmory only using pointers based on its arguments.
Definition at line 550 of file Function.h.
References hasFnAttribute().
|
inline |
Determine if the function may only access memory that is either inaccessible from the IR or pointed to by its arguments.
Definition at line 566 of file Function.h.
References hasFnAttribute().
|
inline |
Determine if the function may only access memory that is inaccessible from the IR.
Definition at line 557 of file Function.h.
References hasFnAttribute().
|
inline |
Determine if the function does not access or only reads memory.
Definition at line 533 of file Function.h.
References doesNotAccessMemory(), and hasFnAttribute().
Referenced by doesNotFreeMemory(), and HandleByValArgument().
void Function::print | ( | raw_ostream & | OS, |
AssemblyAnnotationWriter * | AAW = nullptr , |
||
bool | ShouldPreserveUseListOrder = false , |
||
bool | IsForDebug = false |
||
) | const |
Print the function to an output stream with an optional AssemblyAnnotationWriter.
Definition at line 4486 of file AsmWriter.cpp.
References llvm::GlobalValue::getParent(), and llvm::RISCVFenceField::W.
Referenced by llvm::StackLifetime::print().
void Function::recalculateIntrinsicID | ( | ) |
Recalculate the ID for this function if it is an Intrinsic defined in llvm/Intrinsics.h.
Sets the intrinsic ID to Intrinsic::not_intrinsic if the name of this function does not match an intrinsic in that header. Note, this method does not need to be called directly, as it is called from Value::setName() whenever the name of this function changes.
Definition at line 703 of file Function.cpp.
References llvm::Value::getName(), llvm::GlobalValue::HasLLVMReservedName, llvm::GlobalValue::IntID, lookupIntrinsicID(), and llvm::Intrinsic::not_intrinsic.
void Function::removeAttribute | ( | unsigned | i, |
Attribute::AttrKind | Kind | ||
) |
removes the attribute from the list of attributes.
Definition at line 524 of file Function.cpp.
References getAttributes(), getContext(), i, llvm::AttributeList::removeAttribute(), and setAttributes().
Referenced by addIfNotExistent(), emitBinaryFloatFnCallHelper(), emitUnaryFloatFnCallHelper(), removeFnAttr(), and StripAttr().
void Function::removeAttribute | ( | unsigned | i, |
StringRef | Kind | ||
) |
removes the attribute from the list of attributes.
Definition at line 530 of file Function.cpp.
References getAttributes(), getContext(), i, llvm::AttributeList::removeAttribute(), and setAttributes().
void Function::removeAttributes | ( | unsigned | i, |
const AttrBuilder & | Attrs | ||
) |
removes the attributes from the list of attributes.
Definition at line 536 of file Function.cpp.
References Attrs, getAttributes(), getContext(), i, llvm::AttributeList::removeAttributes(), and setAttributes().
|
inline |
Remove function attributes from this function.
Definition at line 261 of file Function.h.
References llvm::AttributeList::FunctionIndex, and removeAttribute().
Referenced by EnumAttr::set(), and setNotConvergent().
|
inline |
Remove function attribute from this function.
Definition at line 266 of file Function.h.
References llvm::AttributeList::FunctionIndex, getAttributes(), getContext(), removeAttribute(), and setAttributes().
void Function::removeFromParent | ( | ) |
removeFromParent - This method unlinks 'this' from the containing module, but does not delete it.
Definition at line 317 of file Function.cpp.
References llvm::Module::getFunctionList(), llvm::ilist_node_impl< ilist_detail::compute_node_options< Function, Options... >::type >::getIterator(), and llvm::GlobalValue::getParent().
Referenced by llvm::OpenMPIRBuilder::finalize().
void Function::removeParamAttr | ( | unsigned | ArgNo, |
Attribute::AttrKind | Kind | ||
) |
removes the attribute from the list of attributes.
Definition at line 542 of file Function.cpp.
References getAttributes(), getContext(), llvm::AttributeList::removeParamAttribute(), and setAttributes().
Referenced by llvm::Argument::removeAttr().
void Function::removeParamAttr | ( | unsigned | ArgNo, |
StringRef | Kind | ||
) |
removes the attribute from the list of attributes.
Definition at line 548 of file Function.cpp.
References getAttributes(), getContext(), llvm::AttributeList::removeParamAttribute(), and setAttributes().
void Function::removeParamAttrs | ( | unsigned | ArgNo, |
const AttrBuilder & | Attrs | ||
) |
removes the attribute from the list of attributes.
Definition at line 554 of file Function.cpp.
References Attrs, getAttributes(), getContext(), llvm::AttributeList::removeParamAttributes(), and setAttributes().
|
inline |
Determine if the parameter or return value is marked with NoAlias attribute.
Definition at line 670 of file Function.h.
References llvm::AttributeList::hasAttribute(), llvm::NoAlias, and llvm::AttributeList::ReturnIndex.
|
inline |
Set the attribute list for this Function.
Definition at line 242 of file Function.h.
References Attrs.
Referenced by addAttribute(), addAttributes(), llvm::Argument::addAttrs(), addDereferenceableAttr(), addDereferenceableOrNullAttr(), addDereferenceableOrNullParamAttr(), addDereferenceableParamAttr(), addParamAttr(), addParamAttrs(), llvm::CloneFunctionInto(), copyAttributesFrom(), doPromotion(), llvm::IRAttributeManifest::manifestAttrs(), removeAttribute(), removeAttributes(), llvm::IRPosition::removeAttrs(), removeFnAttr(), removeParamAttr(), and removeParamAttrs().
|
inline |
Definition at line 232 of file Function.h.
References assert(), llvm::Value::getSubclassDataFromValue(), and llvm::CallingConv::MaxID.
Referenced by copyAttributesFrom(), and llvm::InlineFunction().
|
inline |
Definition at line 596 of file Function.h.
References addFnAttr().
|
inline |
Definition at line 604 of file Function.h.
References addFnAttr(), and llvm::MCID::Convergent.
|
inline |
Definition at line 528 of file Function.h.
References addFnAttr().
|
inline |
Definition at line 623 of file Function.h.
References addFnAttr().
|
inline |
Definition at line 544 of file Function.h.
References addFnAttr().
|
inline |
Definition at line 632 of file Function.h.
References addFnAttr().
|
inline |
Definition at line 577 of file Function.h.
References addFnAttr().
|
inline |
Definition at line 588 of file Function.h.
References addFnAttr().
void Function::setEntryCount | ( | ProfileCount | Count, |
const DenseSet< GlobalValue::GUID > * | Imports = nullptr |
||
) |
Set the entry count for this function.
Entry count is the number of times this function was executed based on pgo data. Imports
points to a set of GUIDs that needs to be imported by the function for sample PGO, to enable the same inlines as the profiled optimized binary.
Definition at line 1729 of file Function.cpp.
References assert(), llvm::MDBuilder::createFunctionEntryCount(), getContext(), llvm::Function::ProfileCount::getCount(), getEntryCount(), getImportGUIDs(), llvm::Function::ProfileCount::getType(), llvm::Function::ProfileCount::hasValue(), llvm::Function::ProfileCount::isSynthetic(), S, and llvm::Value::setMetadata().
Referenced by setEntryCount().
void Function::setEntryCount | ( | uint64_t | Count, |
Function::ProfileCountType | Type = PCT_Real , |
||
const DenseSet< GlobalValue::GUID > * | Imports = nullptr |
||
) |
A convenience wrapper for setting entry count.
Definition at line 1747 of file Function.cpp.
References setEntryCount().
void Function::setGC | ( | std::string | Str | ) |
Definition at line 605 of file Function.cpp.
References getContext(), move, and llvm::LLVMContext::setGC().
Referenced by copyAttributesFrom().
|
inline |
Definition at line 652 of file Function.h.
References addFnAttr().
|
inline |
Definition at line 183 of file Function.h.
References llvm::GlobalObject::getGlobalObjectSubClassData(), llvm::BitmaskEnumDetail::Mask(), and llvm::GlobalObject::setGlobalObjectSubClassData().
Referenced by dropAllReferences().
|
inline |
Definition at line 641 of file Function.h.
References addFnAttr().
|
inline |
Definition at line 607 of file Function.h.
References llvm::MCID::Convergent, and removeFnAttr().
|
inline |
Definition at line 553 of file Function.h.
References addFnAttr().
|
inline |
Definition at line 569 of file Function.h.
References addFnAttr().
|
inline |
Definition at line 560 of file Function.h.
References addFnAttr().
|
inline |
Definition at line 536 of file Function.h.
References addFnAttr().
void Function::setPersonalityFn | ( | Constant * | Fn | ) |
Definition at line 1670 of file Function.cpp.
Referenced by llvm::CloneFunctionInto(), and copyAttributesFrom().
void Function::setPrefixData | ( | Constant * | PrefixData | ) |
Definition at line 1680 of file Function.cpp.
Referenced by copyAttributesFrom().
void Function::setPrologueData | ( | Constant * | PrologueData | ) |
Definition at line 1690 of file Function.cpp.
Referenced by copyAttributesFrom().
|
inline |
Definition at line 674 of file Function.h.
References addAttribute(), llvm::NoAlias, and llvm::AttributeList::ReturnIndex.
void Function::setSectionPrefix | ( | StringRef | Prefix | ) |
Set the section prefix for this function.
Definition at line 1786 of file Function.cpp.
References llvm::MDBuilder::createFunctionSectionPrefix(), getContext(), llvm::cl::Prefix, and llvm::Value::setMetadata().
|
inline |
Definition at line 615 of file Function.h.
References addFnAttr().
void Function::setSubprogram | ( | DISubprogram * | SP | ) |
Set the attached subprogram.
Calls setMetadata() with LLVMContext::MD_dbg.
Definition at line 1509 of file Metadata.cpp.
References llvm::Value::setMetadata().
Referenced by fixupDebugInfoPostExtraction().
|
inline |
Definition at line 645 of file Function.h.
References addFnAttr().
|
inline |
Definition at line 752 of file Function.h.
Referenced by addVariantDeclaration(), llvm::computeSignatureVTs(), findMainViewFileID(), gatherFileIDs(), llvm::AttributeList::get(), llvm::DOTGraphTraits< DOTFuncInfo * >::getEdgeAttributes(), InitializeUniqueCases(), llvm::ARMLegalizerInfo::legalizeCustom(), llvm::GraphTraits< DOTFuncInfo * >::size(), and llvm::GraphTraits< DOTFuncMSSAInfo * >::size().
void Function::stealArgumentListFrom | ( | Function & | Src | ) |
Steal arguments from another function.
Drop this function's arguments and splice in the ones from Src
. Requires that this has no function body.
Definition at line 421 of file Function.cpp.
References llvm::all_of(), arg_size(), assert(), llvm::Value::getSubclassDataFromValue(), hasLazyArguments(), llvm::GlobalValue::isDeclaration(), and makeArgArray().
void Function::viewCFG | ( | ) | const |
viewCFG - This function is meant for use from the debugger.
You can just say 'call F->viewCFG()' and a ghostview window should pop up from the program, displaying the CFG of the current function with the code for each basic block inside. This depends on there being a 'dot' and 'gv' program in your path.
You can just say 'call F->viewCFG()' and a ghostview window should pop up from the program, displaying the CFG of the current function. This depends on there being a 'dot' and 'gv' program in your path.
Definition at line 243 of file CFGPrinter.cpp.
Referenced by viewCFGOnly().
void Function::viewCFG | ( | bool | ViewCFGOnly, |
const BlockFrequencyInfo * | BFI, | ||
const BranchProbabilityInfo * | BPI | ||
) | const |
Extended form to print edge weights.
Definition at line 245 of file CFGPrinter.cpp.
References llvm::AMDGPUISD::BFI, CFGFuncName, contains(), llvm::getMaxFreq(), llvm::Value::getName(), and ViewGraph().
void Function::viewCFGOnly | ( | ) | const |
viewCFGOnly - This function is meant for use from the debugger.
It works just like viewCFG, but it does not include the contents of basic blocks into the nodes, just the label. If you are only interested in the CFG this can make the graph smaller.
Definition at line 258 of file CFGPrinter.cpp.
void Function::viewCFGOnly | ( | const BlockFrequencyInfo * | BFI, |
const BranchProbabilityInfo * | BPI | ||
) | const |
Extended form to print edge weights.
Definition at line 260 of file CFGPrinter.cpp.
References llvm::AMDGPUISD::BFI, and viewCFG().
|
inline |
Determine if the function will return.
Definition at line 644 of file Function.h.
References hasFnAttribute().
|
friend |
Definition at line 99 of file Function.h.