|
LLVM
3.7.0
|
#include <Function.h>
Public Member Functions | |
| ~Function () override | |
| DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value) | |
| Provide fast operand accessors. More... | |
| bool | hasPersonalityFn () const |
| Get the personality function associated with this function. More... | |
| Constant * | getPersonalityFn () const |
| void | setPersonalityFn (Constant *C) |
| Type * | getReturnType () const |
| FunctionType * | getFunctionType () const |
| 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 |
| 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) |
| AttributeSet | getAttributes () const |
| Return the attribute list for this Function. More... | |
| void | setAttributes (AttributeSet attrs) |
| Set the attribute list for this Function. More... | |
| void | addFnAttr (Attribute::AttrKind N) |
| Add function attributes to this function. More... | |
| void | removeFnAttr (Attribute::AttrKind N) |
| Remove function attributes from this function. More... | |
| void | addFnAttr (StringRef Kind) |
| Add function attributes to this function. More... | |
| void | addFnAttr (StringRef Kind, StringRef Value) |
| void | setEntryCount (uint64_t Count) |
| Set the entry count for this function. More... | |
| Optional< uint64_t > | getEntryCount () const |
| Get the entry count for this function. More... | |
| bool | hasFnAttribute (Attribute::AttrKind Kind) const |
| Return true if the function has the attribute. More... | |
| bool | hasFnAttribute (StringRef Kind) const |
| Attribute | getFnAttribute (Attribute::AttrKind Kind) const |
| Return the attribute for the given attribute kind. More... | |
| Attribute | getFnAttribute (StringRef Kind) const |
| unsigned | getFnStackAlignment () 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 char * | getGC () const |
| void | setGC (const char *Str) |
| void | clearGC () |
| void | addAttribute (unsigned i, Attribute::AttrKind attr) |
| adds the attribute to the list of attributes. More... | |
| void | addAttributes (unsigned i, AttributeSet attrs) |
| adds the attributes to the list of attributes. More... | |
| void | removeAttributes (unsigned i, AttributeSet attr) |
| removes the attributes from the list of attributes. More... | |
| void | addDereferenceableAttr (unsigned i, uint64_t Bytes) |
| adds the dereferenceable attribute to the list of attributes. More... | |
| void | addDereferenceableOrNullAttr (unsigned i, uint64_t Bytes) |
| adds the dereferenceable_or_null attribute to the list of attributes. More... | |
| unsigned | getParamAlignment (unsigned i) const |
| Extract the alignment for a call or parameter (0=unknown). More... | |
| uint64_t | getDereferenceableBytes (unsigned i) const |
| Extract the number of dereferenceable bytes for a call or parameter (0=unknown). More... | |
| uint64_t | getDereferenceableOrNullBytes (unsigned i) const |
| Extract the number of dereferenceable_or_null bytes for a call or parameter (0=unknown). 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 | onlyAccessesArgMemory () const |
| Determine if the call can access memmory only using pointers based on its arguments. More... | |
| void | setOnlyAccessesArgMemory () |
| bool | doesNotReturn () const |
| Determine if the function cannot return. More... | |
| void | setDoesNotReturn () |
| 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 () |
| 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 pointer argument. More... | |
| bool | doesNotAlias (unsigned n) const |
| Determine if the parameter does not alias other parameters. More... | |
| void | setDoesNotAlias (unsigned n) |
| bool | doesNotCapture (unsigned n) const |
| Determine if the parameter can be captured. More... | |
| void | setDoesNotCapture (unsigned n) |
| bool | doesNotAccessMemory (unsigned n) const |
| void | setDoesNotAccessMemory (unsigned n) |
| bool | onlyReadsMemory (unsigned n) const |
| void | setOnlyReadsMemory (unsigned n) |
| void | copyAttributesFrom (const GlobalValue *Src) override |
| 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 () override |
| removeFromParent - This method unlinks 'this' from the containing module, but does not delete it. More... | |
| void | eraseFromParent () override |
| eraseFromParent - This method unlinks 'this' from the containing module and deletes it. More... | |
| const ArgumentListType & | getArgumentList () const |
| Get the underlying elements of the Function... More... | |
| ArgumentListType & | getArgumentList () |
| const BasicBlockListType & | getBasicBlockList () const |
| BasicBlockListType & | getBasicBlockList () |
| const BasicBlock & | getEntryBlock () const |
| BasicBlock & | getEntryBlock () |
| ValueSymbolTable & | getValueSymbolTable () |
| getSymbolTable() - Return the symbol table... 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 | hasPrefixData () const |
| Constant * | getPrefixData () const |
| void | setPrefixData (Constant *PrefixData) |
| bool | hasPrologueData () const |
| Constant * | getPrologueData () const |
| void | setPrologueData (Constant *PrologueData) |
| void | print (raw_ostream &OS, AssemblyAnnotationWriter *AAW=nullptr) 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 | viewCFGOnly () const |
| viewCFGOnly - This function is meant for use from the debugger. 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) 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... | |
| bool | hasMetadata () const |
| Check if this has any metadata. More... | |
| void | getAllMetadata (SmallVectorImpl< std::pair< unsigned, MDNode * >> &MDs) const |
| Get all current metadata attachments. More... | |
| void | dropUnknownMetadata (ArrayRef< unsigned > KnownIDs) |
| Drop metadata not in the given list. More... | |
Function Argument Iteration | |
| arg_iterator | arg_begin () |
| const_arg_iterator | arg_begin () const |
| arg_iterator | arg_end () |
| const_arg_iterator | arg_end () const |
| iterator_range< arg_iterator > | args () |
| iterator_range < const_arg_iterator > | args () const |
| MDNode * | getMetadata (unsigned KindID) const |
| Get the current metadata attachment, if any. More... | |
| MDNode * | getMetadata (StringRef Kind) const |
| void | setMetadata (unsigned KindID, MDNode *MD) |
| Set a particular kind of metadata attachment. More... | |
| void | setMetadata (StringRef Kind, MDNode *MD) |
Public Member Functions inherited from llvm::GlobalObject | |
| unsigned | getAlignment () const |
| void | setAlignment (unsigned Align) |
| unsigned | getGlobalObjectSubClassData () const |
| void | setGlobalObjectSubClassData (unsigned Val) |
| bool | hasSection () const |
| const char * | getSection () const |
| void | setSection (StringRef S) |
| bool | hasComdat () const |
| const Comdat * | getComdat () const |
| Comdat * | getComdat () |
| void | setComdat (Comdat *C) |
| void | copyAttributesFrom (const GlobalValue *Src) override |
| Copy all additional attributes (those not needed to create a GlobalValue) from the GlobalValue Src to this one. More... | |
Public Member Functions inherited from llvm::GlobalValue | |
| ~GlobalValue () override | |
| unsigned | getAlignment () const |
| bool | hasUnnamedAddr () const |
| void | setUnnamedAddr (bool Val) |
| bool | hasComdat () const |
| Comdat * | getComdat () |
| const Comdat * | getComdat () const |
| 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 |
| const char * | getSection () const |
| PointerType * | getType () const |
| Global values are always pointers. More... | |
| Type * | getValueType () 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 |
| void | setLinkage (LinkageTypes LT) |
| LinkageTypes | getLinkage () const |
| bool | isDiscardableIfUnused () const |
| bool | mayBeOverridden () const |
| bool | isWeakForLinker () const |
| 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... | |
| Module * | getParent () |
| Get the module that this global value is contained inside of... More... | |
| const Module * | getParent () const |
| 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... | |
| bool | isDematerializable () const |
| Returns true if this function was loaded from a GVMaterializer that's still attached to its Module and that knows how to dematerialize the function. More... | |
| std::error_code | materialize () |
| Make sure this GlobalValue is fully read. More... | |
| void | dematerialize () |
| If this GlobalValue is read in, and if the GVMaterializer supports it, release the memory for the function, and set it up to be materialized lazily. More... | |
Public Member Functions inherited from llvm::Constant | |
| bool | isNullValue () const |
| isNullValue - 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 | isAllOnesValue () const |
| isAllOnesValue - Return true if this is the value that would be returned by getAllOnesValue. More... | |
| bool | isNegativeZeroValue () const |
| isNegativeZeroValue - 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. More... | |
| bool | isMinSignedValue () const |
| Return true if the value is the smallest signed value. More... | |
| bool | canTrap () const |
| canTrap - Return true if evaluation of this constant could trap. More... | |
| bool | isThreadDependent () const |
| isThreadDependent - 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 |
| isConstantUsed - Return true if the constant has users other than constant exprs and other dangling things. More... | |
| PossibleRelocationsTy | getRelocationInfo () const |
| getRelocationInfo - This method classifies the entry according to whether or not it may generate a relocation entry. More... | |
| Constant * | getAggregateElement (unsigned Elt) const |
| getAggregateElement - 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 () const |
| getSplatValue - If this is a splat vector constant, meaning that all of the elements 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 *, Use *) |
| This method is a special form of User::replaceUsesOfWith (which does not work on constants) that does work on constants. More... | |
| void | removeDeadConstantUsers () const |
| removeDeadConstantUsers - If there are any dead constant users dangling off of this constant, remove them. More... | |
| Constant * | stripPointerCasts () |
| const Constant * | stripPointerCasts () const |
Public Member Functions inherited from llvm::User | |
| ~User () override | |
| void | operator delete (void *Usr) |
| Free memory allocated for User and Use objects. More... | |
| void | operator delete (void *, unsigned) |
| Placement delete - required by std, but never called. More... | |
| void | operator delete (void *, unsigned, bool) |
| Placement delete - required by std, but never called. More... | |
| Use * | getOperandList () |
| const Use * | getOperandList () const |
| Value * | getOperand (unsigned i) const |
| void | setOperand (unsigned i, Value *Val) |
| const Use & | getOperandUse (unsigned i) const |
| Use & | getOperandUse (unsigned i) |
| unsigned | getNumOperands () const |
| void | setGlobalVariableNumOperands (unsigned NumOps) |
| Set the number of operands on a GlobalVariable. More... | |
| void | setFunctionNumOperands (unsigned NumOps) |
| Set the number of operands on a Function. More... | |
| void | setNumHungOffUseOperands (unsigned NumOps) |
| Subclasses with hung off uses need to manage the operand count themselves. 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 () |
| void | dropAllReferences () |
| Drop all references to operands. More... | |
| void | replaceUsesOfWith (Value *From, Value *To) |
| Replace uses of one Value with another. More... | |
Public Member Functions inherited from llvm::Value | |
| virtual | ~Value () |
| 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... | |
| void | replaceAllUsesWith (Value *V) |
| Change all uses of this to point to a new Value. 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... | |
| bool | use_empty () 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 > | uses () |
| iterator_range < const_use_iterator > | uses () const |
| bool | user_empty () 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 > | users () |
| iterator_range < const_user_iterator > | users () const |
| bool | hasOneUse () const |
| Return true if there is exactly one user of this value. More... | |
| bool | hasNUses (unsigned N) const |
| Return true if this Value has exactly N users. More... | |
| bool | hasNUsesOrMore (unsigned N) const |
| Return true if this value has N users or more. 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... | |
| void | intersectOptionalDataWith (const Value *V) |
| Clear any optional flags not set in the given Value. 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... | |
| Value * | stripPointerCasts () |
| Strip off pointer casts, all-zero GEPs, and aliases. More... | |
| const Value * | stripPointerCasts () const |
| Value * | stripPointerCastsNoFollowAliases () |
| Strip off pointer casts and all-zero GEPs. More... | |
| const Value * | stripPointerCastsNoFollowAliases () const |
| Value * | stripInBoundsConstantOffsets () |
| Strip off pointer casts and all-constant inbounds GEPs. More... | |
| const Value * | stripInBoundsConstantOffsets () const |
| Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) |
| Accumulate offsets from stripInBoundsConstantOffsets(). More... | |
| const Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const |
| Value * | stripInBoundsOffsets () |
| Strip off pointer casts and inbounds GEPs. More... | |
| const Value * | stripInBoundsOffsets () const |
| Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) |
| Translate PHI node to its predecessor from the given basic block. More... | |
| const Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const |
| 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) const |
| Implement operator<< on Value. More... | |
| void | print (raw_ostream &O, ModuleSlotTracker &MST) 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 |
Public Member Functions inherited from llvm::ilist_node< Function > | |
| Function * | getPrevNode () |
| Get the previous node, or 0 for the list head. More... | |
| const Function * | getPrevNode () const |
| Get the previous node, or 0 for the list head. More... | |
| Function * | getNextNode () |
| Get the next node, or 0 for the list tail. More... | |
| const Function * | getNextNode () const |
| Get the next node, or 0 for the list tail. More... | |
Static Public Member Functions | |
| static Function * | Create (FunctionType *Ty, LinkageTypes Linkage, const Twine &N="", Module *M=nullptr) |
| static iplist< Argument > Function::* | getSublistAccess (Argument *) |
| static iplist< BasicBlock > Function::* | getSublistAccess (BasicBlock *) |
| static bool | classof (const Value *V) |
| Methods for support type inquiry through isa, cast, and dyn_cast: More... | |
Static Public Member Functions inherited from llvm::GlobalObject | |
| static bool | classof (const Value *V) |
Static Public Member Functions inherited from llvm::GlobalValue | |
| 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 | isDiscardableIfUnused (LinkageTypes Linkage) |
| Whether the definition of this global may be discarded if it is not used in its compilation unit. More... | |
| static bool | mayBeOverridden (LinkageTypes Linkage) |
| Whether the definition of this global may be replaced by something non-equivalent at link time. More... | |
| static bool | isWeakForLinker (LinkageTypes Linkage) |
| Whether the definition of this global may be replaced at link time. More... | |
| static StringRef | getRealLinkageName (StringRef Name) |
| If special LLVM prefix that is used to inform the asm printer to not emit usual symbol prefix before the symbol name is used then return linkage name after skipping this special LLVM prefix. More... | |
| static bool | classof (const Value *V) |
Static Public Member Functions inherited from llvm::Constant | |
| static bool | classof (const Value *V) |
| static Constant * | getNullValue (Type *Ty) |
| static Constant * | getAllOnesValue (Type *Ty) |
| Get the all ones value. More... | |
| static Constant * | getIntegerValue (Type *Ty, const APInt &V) |
| getIntegerValue - Return the value for an integer or pointer constant, or a vector thereof, with the given scalar value. More... | |
Static Public Member Functions inherited from llvm::User | |
| static bool | classof (const Value *V) |
Friends | |
| class | SymbolTableListTraits< Function, Module > |
Additional Inherited Members | |
Static Public Attributes inherited from llvm::Value | |
| static const unsigned | MaxAlignmentExponent = 29 |
| The maximum alignment for instructions. More... | |
| static const unsigned | MaximumAlignment = 1u << MaxAlignmentExponent |
Protected Types inherited from llvm::Value | |
| enum | : unsigned { NumUserOperandsBits = 29 } |
| The number of operands in the subclass. More... | |
Protected Member Functions inherited from llvm::GlobalObject | |
| GlobalObject (PointerType *Ty, ValueTy VTy, Use *Ops, unsigned NumOps, LinkageTypes Linkage, const Twine &Name) | |
Protected Member Functions inherited from llvm::GlobalValue | |
| GlobalValue (PointerType *Ty, ValueTy VTy, Use *Ops, unsigned NumOps, LinkageTypes Linkage, const Twine &Name) | |
| unsigned | getGlobalValueSubClassData () const |
| void | setGlobalValueSubClassData (unsigned V) |
Protected Member Functions inherited from llvm::Constant | |
| Constant (Type *ty, ValueTy vty, Use *Ops, unsigned NumOps) | |
Protected Member Functions inherited from llvm::User | |
| 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... | |
| User (Type *ty, unsigned vty, Use *OpList, 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... | |
| template<int Idx> | |
| Use & | Op () |
| template<int Idx> | |
| const Use & | Op () const |
Protected Member Functions inherited from llvm::Value | |
| Value (Type *Ty, unsigned scid) | |
| unsigned short | getSubclassDataFromValue () const |
| void | setValueSubclassData (unsigned short D) |
Protected Member Functions inherited from llvm::ilist_node< Function > | |
| ilist_node () | |
Static Protected Member Functions inherited from llvm::User | |
| template<int Idx, typename U > | |
| static Use & | OpFrom (const U *that) |
Protected Attributes inherited from llvm::GlobalObject | |
| std::string | Section |
| Comdat * | ObjComdat |
Protected Attributes inherited from llvm::GlobalValue | |
| LinkageTypes | Linkage: 5 |
| unsigned | Visibility: 2 |
| unsigned | UnnamedAddr: 1 |
| unsigned | DllStorageClass: 2 |
| unsigned | ThreadLocal: 3 |
| Intrinsic::ID | IntID |
| The intrinsic ID for this subclass (which must be a Function). More... | |
| Module * | Parent |
Protected Attributes inherited from llvm::Value | |
| unsigned char | SubclassOptionalData: 7 |
| Hold subclass data that can be dropped. More... | |
| unsigned | NumUserOperands: NumUserOperandsBits |
| bool | IsUsedByMD: 1 |
| bool | HasName: 1 |
| bool | HasHungOffUses: 1 |
Static Protected Attributes inherited from llvm::GlobalObject | |
| static const unsigned | AlignmentBits = 5 |
| static const unsigned | GlobalObjectSubClassDataBits |
Static Protected Attributes inherited from llvm::GlobalValue | |
| static const unsigned | GlobalValueSubClassDataBits = 19 |
Definition at line 53 of file Function.h.
Definition at line 62 of file Function.h.
Definition at line 55 of file Function.h.
Definition at line 56 of file Function.h.
Definition at line 63 of file Function.h.
Definition at line 60 of file Function.h.
Definition at line 59 of file Function.h.
|
override |
Definition at line 273 of file Function.cpp.
References llvm::iplist< NodeTy, Traits >::clear(), clearGC(), dropAllReferences(), and llvm::User::setFunctionNumOperands().
| void Function::addAttribute | ( | unsigned | i, |
| Attribute::AttrKind | attr | ||
| ) |
adds the attribute to the list of attributes.
Definition at line 341 of file Function.cpp.
References llvm::AttributeSet::addAttribute(), getAttributes(), getContext(), and setAttributes().
Referenced by setDoesNotAccessMemory(), setDoesNotAlias(), setDoesNotCapture(), and setOnlyReadsMemory().
| void Function::addAttributes | ( | unsigned | i, |
| AttributeSet | attrs | ||
| ) |
adds the attributes to the list of attributes.
Definition at line 347 of file Function.cpp.
References llvm::AttributeSet::addAttributes(), getAttributes(), getContext(), and setAttributes().
Referenced by llvm::Argument::addAttr(), LLVMAddTargetDependentFunctionAttr(), and removeUseSoftFloat().
| void Function::addDereferenceableAttr | ( | unsigned | i, |
| uint64_t | Bytes | ||
| ) |
adds the dereferenceable attribute to the list of attributes.
Definition at line 359 of file Function.cpp.
References llvm::AttributeSet::addDereferenceableAttr(), getAttributes(), getContext(), and setAttributes().
| void Function::addDereferenceableOrNullAttr | ( | unsigned | i, |
| uint64_t | Bytes | ||
| ) |
adds the dereferenceable_or_null attribute to the list of attributes.
Definition at line 365 of file Function.cpp.
References llvm::AttributeSet::addDereferenceableOrNullAttr(), getAttributes(), getContext(), and setAttributes().
|
inline |
Add function attributes to this function.
Definition at line 187 of file Function.h.
References llvm::AttributeSet::addAttribute(), llvm::AttributeSet::FunctionIndex, getContext(), and setAttributes().
Referenced by AdjustCallerSSPLevel(), assureFPCallStub(), createFPFnStub(), fixupFPReturnAndCall(), setCannotDuplicate(), setConvergent(), setDoesNotAccessMemory(), setDoesNotReturn(), setDoesNotThrow(), setHasUWTable(), setOnlyAccessesArgMemory(), and setOnlyReadsMemory().
|
inline |
Add function attributes to this function.
Definition at line 199 of file Function.h.
References llvm::AttributeSet::addAttribute(), llvm::AttributeSet::FunctionIndex, getContext(), and setAttributes().
Definition at line 204 of file Function.h.
References llvm::AttributeSet::addAttribute(), llvm::AttributeSet::FunctionIndex, getContext(), and setAttributes().
|
inline |
Definition at line 472 of file Function.h.
References llvm::iplist< NodeTy, Traits >::begin().
Referenced by AddAliasScopeMetadata(), AddAlignmentAssumptions(), addByteCountSuffix(), args(), llvm::Interpreter::callFunction(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneFunction(), llvm::orc::cloneFunctionDecl(), llvm::CloneFunctionInto(), llvm::CloneModule(), determinePointerReadAttrs(), EnsureFPIntrinsicsExist(), FunctionNumber(), llvm::Argument::getArgNo(), llvm::objcarc::GetFunctionClass(), llvm::SparcTargetLowering::getSRetArgSize(), HasNestArgument(), llvm::HexagonEvaluator::HexagonEvaluator(), llvm::ValueEnumerator::incorporateFunction(), llvm::InlineFunction(), isDynamicConstant(), LLVMGetFirstParam(), LLVMGetLastParam(), LLVMGetParams(), LLVMGetPreviousParam(), llvm::FastISel::lowerArguments(), and UpgradeIntrinsicFunction1().
|
inline |
Definition at line 476 of file Function.h.
References llvm::iplist< NodeTy, Traits >::begin().
| bool Function::arg_empty | ( | ) | const |
Definition at line 304 of file Function.cpp.
References getFunctionType(), and llvm::FunctionType::getNumParams().
|
inline |
Definition at line 480 of file Function.h.
References llvm::iplist< NodeTy, Traits >::end().
Referenced by AddAliasScopeMetadata(), AddAlignmentAssumptions(), addByteCountSuffix(), args(), llvm::Interpreter::callFunction(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneFunction(), llvm::orc::cloneFunctionDecl(), llvm::CloneFunctionInto(), determinePointerReadAttrs(), EnsureFPIntrinsicsExist(), FunctionNumber(), llvm::objcarc::GetFunctionClass(), HasNestArgument(), llvm::HexagonEvaluator::HexagonEvaluator(), llvm::ValueEnumerator::incorporateFunction(), llvm::InlineFunction(), LLVMGetFirstParam(), LLVMGetLastParam(), LLVMGetNextParam(), LLVMGetParams(), and llvm::FastISel::lowerArguments().
|
inline |
Definition at line 484 of file Function.h.
References llvm::iplist< NodeTy, Traits >::end().
| size_t Function::arg_size | ( | ) | const |
Definition at line 301 of file Function.cpp.
References getFunctionType(), and llvm::FunctionType::getNumParams().
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), llvm::Interpreter::callFunction(), llvm::TargetTransformInfoImplCRTPBase< AMDGPUTTIImpl >::getCallCost(), llvm::InlineFunction(), needsFPFromSig(), needsFPStubFromParams(), UpgradeIntrinsicFunction1(), and whichFPParamVariantNeeded().
|
inline |
Definition at line 489 of file Function.h.
References arg_begin(), and arg_end().
Referenced by buildSetsFrom(), llvm::CloneFunctionInto(), and llvm::orc::makeStub().
|
inline |
Definition at line 493 of file Function.h.
References arg_begin(), and arg_end().
|
inline |
Definition at line 466 of file Function.h.
References llvm::iplist< NodeTy, Traits >::back().
Referenced by llvm::InlineFunction().
|
inline |
Definition at line 467 of file Function.h.
References llvm::iplist< NodeTy, Traits >::back().
|
inline |
Definition at line 457 of file Function.h.
References llvm::iplist< NodeTy, Traits >::begin().
Referenced by llvm::Interpreter::callFunction(), CloneAliasScopeMetadata(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneFunctionInto(), ComputePostOrders(), cxxDtorIsEmpty(), dropAllReferences(), llvm::dumpBlock(), fixupFPReturnAndCall(), functionHasLines(), getCommonReturnValue(), llvm::GraphTraits< BlockFrequencyInfo * >::getEntryNode(), HandleByValArgument(), llvm::ValueEnumerator::incorporateFunction(), IncorporateFunctionInfoGlobalBBIDs(), llvm::InlineFunction(), llvm::InlineCostAnalysis::isInlineViable(), isOnlyUsedInEntryBlock(), iterativelyFlattenCFG(), iterativelySimplifyCFG(), LLVMGetBasicBlocks(), LLVMGetFirstBasicBlock(), LLVMGetLastBasicBlock(), LLVMGetPreviousBasicBlock(), markAliveBlocks(), mergeEmptyReturnBlocks(), needsFP(), llvm::GraphTraits< BlockFrequencyInfo * >::nodes_begin(), llvm::GraphTraits< Function * >::nodes_begin(), llvm::GraphTraits< const Function * >::nodes_begin(), prepareICWorklistFromFunction(), llvm::BranchProbabilityInfo::print(), llvm::SparseSolver::Print(), llvm::removeUnreachableBlocks(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::FunctionLoweringInfo::set(), llvm::SplitAllCriticalEdges(), SplitCriticalSideEffectEdges(), llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit(), WriteFunction(), and WriteMetadataAttachment().
|
inline |
Definition at line 458 of file Function.h.
References llvm::iplist< NodeTy, Traits >::begin().
| 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 916 of file Function.cpp.
References llvm::CS, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::hasFnAttr(), I, llvm::inst_begin(), llvm::inst_end(), and llvm::Attribute::ReturnsTwice.
Referenced by llvm::SelectionDAGISel::runOnMachineFunction().
|
inline |
Determine if the call cannot be duplicated.
Definition at line 325 of file Function.h.
References llvm::AttributeSet::FunctionIndex, llvm::AttributeSet::hasAttribute(), and llvm::Attribute::NoDuplicate.
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition at line 536 of file Function.h.
References llvm::Value::getValueID().
| void Function::clearGC | ( | ) |
Definition at line 399 of file Function.cpp.
References llvm::StringPool::empty(), GCLock, GCNamePool, and GCNames.
Referenced by copyAttributesFrom(), LLVMSetGC(), and ~Function().
|
overridevirtual |
copyAttributesFrom - copy all additional attributes (those not needed to create a Function) from the Function Src to this one.
Reimplemented from llvm::GlobalValue.
Definition at line 416 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 llvm::orc::cloneFunctionDecl(), llvm::CloneFunctionInto(), and llvm::CloneModule().
|
inlinestatic |
Definition at line 121 of file Function.h.
References N.
Referenced by assureFPCallStub(), llvm::CloneFunction(), llvm::orc::cloneFunctionDecl(), llvm::CloneModule(), createFPFnStub(), llvm::createSanitizerCtorAndInitFunctions(), llvm::Module::getOrInsertFunction(), LLVMAddFunction(), and UpgradeIntrinsicFunction1().
| llvm::Function::DECLARE_TRANSPARENT_OPERAND_ACCESSORS | ( | Value | ) |
Provide fast operand accessors.
|
inline |
deleteBody - This method deletes the body of the function, and converts the linkage to external.
Definition at line 405 of file Function.h.
References dropAllReferences(), llvm::GlobalValue::ExternalLinkage, and llvm::GlobalValue::setLinkage().
Referenced by llvm::orc::moveFunctionBody().
|
inline |
Determine if the function does not access memory.
Definition at line 278 of file Function.h.
References llvm::AttributeSet::FunctionIndex, llvm::AttributeSet::hasAttribute(), and llvm::Attribute::ReadNone.
Referenced by onlyReadsMemory().
Definition at line 383 of file Function.h.
References llvm::AttributeSet::hasAttribute(), and llvm::Attribute::ReadNone.
Determine if the parameter does not alias other parameters.
| n | The parameter to check. 1 is the first parameter, 0 is the return |
Definition at line 367 of file Function.h.
References llvm::AttributeSet::hasAttribute(), and llvm::Attribute::NoAlias.
Determine if the parameter can be captured.
| n | The parameter to check. 1 is the first parameter, 0 is the return |
Definition at line 376 of file Function.h.
References llvm::AttributeSet::hasAttribute(), and llvm::Attribute::NoCapture.
|
inline |
Determine if the function cannot return.
Definition at line 307 of file Function.h.
References llvm::AttributeSet::FunctionIndex, llvm::AttributeSet::hasAttribute(), and llvm::Attribute::NoReturn.
|
inline |
Determine if the function cannot unwind.
Definition at line 316 of file Function.h.
References llvm::AttributeSet::FunctionIndex, llvm::AttributeSet::hasAttribute(), and llvm::Attribute::NoUnwind.
Referenced by llvm::EHStreamer::callToNoUnwindFunction(), llvm::StatepointBase< Function, Instruction, Value, CallSite >::doesNotThrow(), needsUnwindTableEntry(), and llvm::InstCombiner::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 320 of file Function.cpp.
References llvm::iplist< NodeTy, Traits >::begin(), begin(), llvm::iplist< NodeTy, Traits >::empty(), end(), I, setIsMaterializable(), setPersonalityFn(), setPrefixData(), and setPrologueData().
Referenced by deleteBody(), llvm::Module::dropAllReferences(), and ~Function().
Drop metadata not in the given list.
Drop all metadata from this not included in KnownIDs.
Definition at line 1226 of file Metadata.cpp.
References llvm::ArrayRef< T >::begin(), llvm::SmallSet< T, N, C >::count(), llvm::ArrayRef< T >::empty(), llvm::ArrayRef< T >::end(), llvm::LLVMContextImpl::FunctionMetadata, getContext(), hasMetadata(), I, llvm::SmallSet< T, N, C >::insert(), llvm::LLVMContext::pImpl, and llvm::SPII::Store.
|
inline |
Definition at line 463 of file Function.h.
References llvm::iplist< NodeTy, Traits >::empty().
Referenced by InsertSafepointPoll(), and llvm::optimizeGlobalCtorsList().
|
inline |
Definition at line 459 of file Function.h.
References llvm::iplist< NodeTy, Traits >::end().
Referenced by CloneAliasScopeMetadata(), llvm::CloneAndPruneIntoFromInst(), llvm::CloneFunctionInto(), llvm::cloneLoopWithPreheader(), ComputePostOrders(), cxxDtorIsEmpty(), dropAllReferences(), llvm::dumpBlock(), fixupFPReturnAndCall(), fixupLineNumbers(), functionHasLines(), getCommonReturnValue(), HandleInlinedInvoke(), llvm::ValueEnumerator::incorporateFunction(), IncorporateFunctionInfoGlobalBBIDs(), llvm::InlineFunction(), llvm::InlineCostAnalysis::isInlineViable(), iterativelyFlattenCFG(), iterativelySimplifyCFG(), LLVMGetBasicBlocks(), LLVMGetFirstBasicBlock(), LLVMGetLastBasicBlock(), LLVMGetNextBasicBlock(), mergeEmptyReturnBlocks(), needsFP(), llvm::GraphTraits< BlockFrequencyInfo * >::nodes_end(), llvm::GraphTraits< Function * >::nodes_end(), llvm::GraphTraits< const Function * >::nodes_end(), placeSplitBlockCarefully(), prepareICWorklistFromFunction(), llvm::BranchProbabilityInfo::print(), llvm::SparseSolver::Print(), llvm::removeUnreachableBlocks(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::FunctionLoweringInfo::set(), llvm::SplitAllCriticalEdges(), SplitCriticalSideEffectEdges(), llvm::UnrollRuntimeLoopProlog(), llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit(), WriteFunction(), and WriteMetadataAttachment().
|
inline |
Definition at line 460 of file Function.h.
References llvm::iplist< NodeTy, Traits >::end().
|
overridevirtual |
eraseFromParent - This method unlinks 'this' from the containing module and deletes it.
Implements llvm::GlobalValue.
Definition at line 241 of file Function.cpp.
References llvm::iplist< NodeTy, Traits >::erase(), llvm::Module::getFunctionList(), and llvm::GlobalValue::getParent().
Referenced by INITIALIZE_PASS(), and llvm::UpgradeCallsToIntrinsic().
|
inline |
Definition at line 464 of file Function.h.
References llvm::iplist< NodeTy, Traits >::front().
Referenced by llvm::CloneAndPruneFunctionInto(), getEntryBlock(), llvm::IntervalIterator< NodeTy, OrigContainer_t, GT, IGT >::IntervalIterator(), and llvm::AllocaInst::isStaticAlloca().
|
inline |
Definition at line 465 of file Function.h.
References llvm::iplist< NodeTy, Traits >::front().
| void Function::getAllMetadata | ( | SmallVectorImpl< std::pair< unsigned, MDNode * >> & | MDs | ) | const |
Get all current metadata attachments.
Definition at line 1216 of file Metadata.cpp.
References llvm::LLVMContextImpl::FunctionMetadata, getContext(), hasMetadata(), and llvm::LLVMContext::pImpl.
Referenced by WriteMetadataAttachment().
|
inline |
Get the underlying elements of the Function...
the basic block list is empty for external functions.
Definition at line 424 of file Function.h.
Referenced by llvm::Argument::Argument(), and needsFPFromSig().
|
inline |
Definition at line 428 of file Function.h.
|
inline |
Return the attribute list for this Function.
Definition at line 181 of file Function.h.
Referenced by addAttribute(), addAttributes(), addDereferenceableAttr(), addDereferenceableOrNullAttr(), llvm::CloneFunctionInto(), copyAttributesFrom(), llvm::XCoreFrameLowering::emitPrologue(), llvm::Argument::hasByValAttr(), llvm::Argument::hasByValOrInAllocaAttr(), llvm::Argument::hasInAllocaAttr(), llvm::Argument::hasNestAttr(), llvm::Argument::hasNoAliasAttr(), llvm::Argument::hasNoCaptureAttr(), llvm::Argument::hasReturnedAttr(), llvm::Argument::hasSExtAttr(), llvm::Argument::hasStructRetAttr(), llvm::Argument::hasZExtAttr(), llvm::HexagonEvaluator::HexagonEvaluator(), llvm::ValueEnumerator::incorporateFunction(), insertSinCosCall(), llvm::TargetLowering::isInTailCallPosition(), isMinSize(), isOptSize(), LLVMAddFunctionAttr(), LLVMGetAttribute(), LLVMGetFunctionAttr(), LLVMRemoveFunctionAttr(), llvm::orc::makeStub(), llvm::WebAssemblyRegisterInfo::needsStackRealignment(), llvm::AArch64RegisterInfo::needsStackRealignment(), llvm::Argument::onlyReadsMemory(), llvm::StatepointBase< Function, Instruction, Value, CallSite >::paramHasAttr(), removeAttributes(), RemoveNestAttribute(), llvm::returnTypeIsEligibleForTailCall(), and llvm::FunctionLoweringInfo::set().
|
inline |
Definition at line 436 of file Function.h.
Referenced by buildGraphFrom(), llvm::CloneAndPruneIntoFromInst(), llvm::cloneLoopWithPreheader(), createStubLandingPad(), llvm::BasicBlock::eraseFromParent(), llvm::InlineFunction(), llvm::BasicBlock::insertInto(), insertUniqueBackedgeBlock(), llvm::BasicBlock::moveAfter(), llvm::BasicBlock::moveBefore(), llvm::BasicBlock::removeFromParent(), llvm::removeUnreachableBlocks(), llvm::SplitCriticalEdge(), llvm::UnrollLoop(), and llvm::UnrollRuntimeLoopProlog().
|
inline |
Definition at line 437 of file Function.h.
|
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 172 of file Function.h.
References llvm::Value::getSubclassDataFromValue().
Referenced by copyAttributesFrom(), llvm::AArch64FrameLowering::determineCalleeSaves(), llvm::ARMFrameLowering::emitEpilogue(), llvm::AArch64FrameLowering::emitEpilogue(), llvm::PPCFrameLowering::emitEpilogue(), llvm::ARMFrameLowering::emitPrologue(), llvm::AArch64FrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), llvm::MSP430RegisterInfo::getCalleeSavedRegs(), llvm::AArch64RegisterInfo::getCalleeSavedRegs(), llvm::PPCRegisterInfo::getCalleeSavedRegs(), llvm::ARMBaseRegisterInfo::getCalleeSavedRegs(), llvm::X86RegisterInfo::getCalleeSavedRegs(), llvm::Mangler::getNameWithPrefix(), llvm::X86RegisterInfo::getPointerRegClass(), llvm::X86RegisterInfo::getReservedRegs(), GetScratchRegister(), llvm::HexagonTargetLowering::IsEligibleForTailCallOptimization(), llvm::isKernelFunction(), isProfitableToMakeFastCC(), and llvm::FunctionLoweringInfo::set().
| LLVMContext & Function::getContext | ( | ) | const |
getContext - Return a reference to the LLVMContext associated with this function.
Definition at line 223 of file Function.cpp.
References llvm::Type::getContext(), and llvm::GlobalValue::getType().
Referenced by AddAliasScopeMetadata(), llvm::Argument::addAttr(), addAttribute(), addAttributes(), addDereferenceableAttr(), addDereferenceableOrNullAttr(), addFnAttr(), AdjustCallerSSPLevel(), llvm::ARMFrameLowering::adjustForSegmentedStacks(), checkStringCopyLibFuncSignature(), CloneAliasScopeMetadata(), llvm::CloneFunctionInto(), combineInstructionsOverFunction(), createFPFnStub(), createStubLandingPad(), dropUnknownMetadata(), duplicateCPV(), llvm::SIRegisterInfo::eliminateFrameIndex(), llvm::LoopAccessReport::emitAnalysis(), emitAnalysis(), llvm::ARMBaseRegisterInfo::emitLoadConstPool(), emitThumb1LoadConstPool(), emitThumb2LoadConstPool(), llvm::FastISel::fastEmit_ri_(), fixupLineNumbers(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::BlockAddress::get(), getAllMetadata(), llvm::ScalarEvolution::getContext(), getMetadata(), getPrefixData(), getPrologueData(), llvm::SelectionDAG::init(), INITIALIZE_PASS(), insertFastDiv(), llvm::isFreeCall(), LLVMAddFunctionAttr(), LLVMAddTargetDependentFunctionAttr(), LLVMRemoveFunctionAttr(), llvm::XCoreInstrInfo::loadImmediate(), llvm::SIInstrInfo::loadRegFromStackSlot(), llvm::BlockAddress::lookup(), llvm::AMDGPUMCInstLower::lower(), llvm::NVPTXTargetLowering::LowerCall(), llvm::NVPTXTargetLowering::LowerReturn(), llvm::Argument::removeAttr(), removeAttributes(), removeFnAttr(), RemoveNestAttribute(), removeUseSoftFloat(), llvm::legacy::FunctionPassManagerImpl::run(), llvm::ExecutionEngine::runFunctionAsMain(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::LPPassManager::runOnFunction(), llvm::Inliner::runOnSCC(), llvm::FastISel::selectExtractValue(), llvm::FunctionLoweringInfo::set(), setEntryCount(), setMetadata(), setPrefixData(), setPrologueData(), llvm::SIInstrInfo::storeRegToStackSlot(), llvm::UnrollLoop(), llvm::UpgradeIntrinsicFunction(), UpgradeIntrinsicFunction1(), and UpgradeSSE41Function().
|
inline |
Extract the number of dereferenceable bytes for a call or parameter (0=unknown).
Definition at line 267 of file Function.h.
References llvm::AttributeSet::getDereferenceableBytes().
Referenced by llvm::Argument::getDereferenceableBytes().
|
inline |
Extract the number of dereferenceable_or_null bytes for a call or parameter (0=unknown).
Definition at line 273 of file Function.h.
References llvm::AttributeSet::getDereferenceableOrNullBytes().
Referenced by llvm::Argument::getDereferenceableOrNullBytes().
|
inline |
Definition at line 442 of file Function.h.
References front().
Referenced by llvm::CloneAndPruneIntoFromInst(), llvm::CloneBasicBlock(), ComputePostOrders(), CreatePrologue(), cxxDtorIsEmpty(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), llvm::FindFunctionBackedges(), findLocationForEntrySafepoint(), llvm::MemoryDependenceAnalysis::getDependency(), llvm::GraphTraits< Function * >::getEntryNode(), llvm::GraphTraits< const Function * >::getEntryNode(), llvm::GraphTraits< Inverse< Function * > >::getEntryNode(), llvm::GraphTraits< Inverse< const Function * > >::getEntryNode(), llvm::MemoryDependenceAnalysis::getNonLocalCallDependency(), llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), INITIALIZE_PASS(), llvm::InlineFunction(), InsertRootInitializers(), insertSinCosCall(), isEmptyFunction(), llvm::SelectionDAGBuilder::isExportableFromCurrentBlock(), llvm::isPotentiallyReachable(), llvm::MergeBasicBlockIntoOnlyPred(), NegateValue(), llvm::RegionInfo::recalculate(), relocationViaAlloca(), llvm::BranchProbabilityInfo::runOnFunction(), llvm::BasicBlockPass::skipOptnoneFunction(), llvm::SparseSolver::Solve(), splitVectorValues(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), TryToSinkInstruction(), ValueDominatesPHI(), and llvm::InstCombiner::visitAllocaInst().
|
inline |
Definition at line 443 of file Function.h.
References front().
| Optional< uint64_t > Function::getEntryCount | ( | ) | const |
Get the entry count for this function.
Definition at line 990 of file Function.cpp.
References getMetadata(), llvm::MDNode::getOperand(), llvm::ConstantInt::getValue(), llvm::APInt::getZExtValue(), llvm::LLVMContext::MD_prof, and llvm::None.
|
inline |
Return the attribute for the given attribute kind.
Definition at line 225 of file Function.h.
References llvm::AttributeSet::FunctionIndex, and llvm::AttributeSet::getAttribute().
Referenced by llvm::NVPTXTargetLowering::allowFMA(), llvm::AMDGPUMachineFunction::AMDGPUMachineFunction(), attributeMatches(), llvm::X86FrameLowering::emitPrologue(), llvm::ARMBaseRegisterInfo::getCalleeSavedRegs(), llvm::AArch64TargetMachine::getSubtargetImpl(), llvm::WebAssemblyTargetMachine::getSubtargetImpl(), llvm::X86TargetMachine::getSubtargetImpl(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::ARMBaseTargetMachine::getSubtargetImpl(), llvm::MipsTargetMachine::getSubtargetImpl(), llvm::MachineModuleInfo::getWinEHParent(), llvm::TargetTransformInfoImplBase::hasCompatibleFunctionAttributes(), isGCLeafFunction(), llvm::RecurrenceDescriptor::isReductionPHI(), llvm::HexagonTargetLowering::LowerCall(), LowerInterruptReturn(), llvm::HexagonTargetLowering::mayBeEmittedAsTailCall(), llvm::TargetFrameLowering::noFramePointerElim(), llvm::LibCallSimplifier::optimizeCall(), llvm::StackProtector::runOnFunction(), and WindowsRequiresStackProbe().
Definition at line 228 of file Function.h.
References llvm::AttributeSet::FunctionIndex, and llvm::AttributeSet::getAttribute().
|
inline |
Return the stack alignment for the function.
Definition at line 233 of file Function.h.
References llvm::AttributeSet::FunctionIndex, and llvm::AttributeSet::getStackAlignment().
Referenced by llvm::MachineFunction::MachineFunction().
| FunctionType * Function::getFunctionType | ( | ) | const |
Definition at line 227 of file Function.cpp.
Referenced by arg_empty(), arg_size(), assureFPCallStub(), llvm::Interpreter::callExternalFunction(), llvm::Interpreter::callFunction(), checkStringCopyLibFuncSignature(), llvm::CloneFunction(), copyFunctionProto(), llvm::IRBuilder< true, TargetFolder >::CreateCall(), createFPFnStub(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::ARMTargetLowering::emitStoreConditional(), FindCXAAtExit(), getAllocationData(), llvm::TargetTransformInfoImplCRTPBase< AMDGPUTTIImpl >::getCallCost(), llvm::Mangler::getNameWithPrefix(), getReturnType(), llvm::InlineFunction(), llvm::isFreeCall(), isMemsetPattern16(), isTrigLibCall(), isVarArg(), lookupFunction(), llvm::HexagonTargetLowering::LowerCall(), llvm::SITargetLowering::LowerFormalArguments(), needsFPStubFromParams(), llvm::Interpreter::runFunction(), llvm::orc::OrcMCJITReplacement::runFunction(), llvm::MCJIT::runFunction(), llvm::ExecutionEngine::runFunctionAsMain(), UpgradeSSE41Function(), UpgradeX86IntrinsicsWith8BitMask(), and whichFPParamVariantNeeded().
| const char * Function::getGC | ( | ) | const |
Definition at line 384 of file Function.cpp.
References GCLock, and hasGC().
Referenced by copyAttributesFrom(), llvm::GCModuleInfo::getFunctionInfo(), llvm::InlineFunction(), LLVMGetGC(), shouldRewriteFunction(), and shouldRewriteStatepointsIn().
|
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 159 of file Function.h.
References llvm::GlobalValue::IntID.
Referenced by llvm::CallGraphNode::addCalledFunction(), llvm::canConstantFoldCallTo(), computeKnownBitsFromAssume(), llvm::ConstantFoldCall(), llvm::TargetTransformInfoImplCRTPBase< AMDGPUTTIImpl >::getCallCost(), llvm::IntrinsicInst::getIntrinsicID(), handleBranchExpect(), handleSwitchExpect(), llvm::InlineCostAnalysis::isInlineViable(), llvm::isStatepoint(), lowerExpectIntrinsic(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::FastISel::selectInstruction(), SimplifyIntrinsic(), llvm::UpgradeIntrinsicCall(), llvm::UpgradeIntrinsicFunction(), and llvm::Interpreter::visitCallSite().
Get the current metadata attachment, if any.
Returns nullptr if such an attachment is missing.
Definition at line 1179 of file Metadata.cpp.
References llvm::LLVMContextImpl::FunctionMetadata, getContext(), hasMetadata(), and llvm::LLVMContext::pImpl.
Referenced by getEntryCount(), and getMetadata().
Definition at line 1185 of file Metadata.cpp.
References getContext(), getMetadata(), and hasMetadata().
Extract the alignment for a call or parameter (0=unknown).
Definition at line 261 of file Function.h.
References llvm::AttributeSet::getParamAlignment().
Referenced by llvm::Argument::getParamAlignment(), INITIALIZE_PASS(), and llvm::InlineFunction().
|
inline |
Definition at line 133 of file Function.h.
References hasPersonalityFn().
Referenced by llvm::AddLandingPadInfo(), llvm::DwarfCFIException::beginFunction(), llvm::WinException::beginFunction(), llvm::canSimplifyInvokeNoUnwind(), copyAttributesFrom(), llvm::WinException::endFunction(), llvm::ARMException::endFunction(), getSEHRegistrationNodeSize(), llvm::InlineFunction(), llvm::FunctionLoweringInfo::set(), and llvm::InstCombiner::visitLandingPadInst().
| Constant * Function::getPrefixData | ( | ) | const |
Definition at line 927 of file Function.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), getContext(), hasPrefixData(), llvm::LLVMContext::pImpl, and llvm::LLVMContextImpl::PrefixDataMap.
Referenced by copyAttributesFrom().
| Constant * Function::getPrologueData | ( | ) | const |
Definition at line 956 of file Function.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), getContext(), hasPrologueData(), llvm::LLVMContext::pImpl, and llvm::LLVMContextImpl::PrologueDataMap.
Referenced by copyAttributesFrom().
| Type * Function::getReturnType | ( | ) | const |
Definition at line 233 of file Function.cpp.
References getFunctionType(), and llvm::FunctionType::getReturnType().
Referenced by assureFPCallStub(), llvm::Interpreter::callFunction(), llvm::ConstantFoldCall(), llvm::IRBuilderBase::getCurrentFunctionReturnType(), getRetComponentType(), llvm::InlineFunction(), llvm::NVPTXTargetLowering::LowerReturn(), llvm::orc::makeStub(), needsFPFromSig(), needsFPReturnHelper(), NumRetVals(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::FastISel::selectStackmap(), llvm::FunctionLoweringInfo::set(), SimplifyIntrinsic(), and UpgradeIntrinsicFunction1().
Definition at line 432 of file Function.h.
|
inlinestatic |
Definition at line 438 of file Function.h.
|
inline |
getSymbolTable() - Return the symbol table...
Definition at line 450 of file Function.h.
Referenced by llvm::ilist_traits< BasicBlock >::getSymTab(), llvm::ilist_traits< Argument >::getSymTab(), llvm::MIRParserImpl::initializeMachineFunction(), and WriteFunction().
|
inline |
Definition at line 451 of file Function.h.
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.
Definition at line 886 of file Function.cpp.
References llvm::CS, and llvm::Value::uses().
|
inline |
Return true if the function has the attribute.
Definition at line 217 of file Function.h.
References llvm::AttributeSet::FunctionIndex, and llvm::AttributeSet::hasAttribute().
Referenced by AdjustCallerSSPLevel(), llvm::NVPTXTargetLowering::allowFMA(), llvm::WinException::beginFunction(), llvm::WebAssemblyRegisterInfo::canRealignStack(), llvm::AArch64RegisterInfo::canRealignStack(), llvm::X86RegisterInfo::canRealignStack(), llvm::ARMBaseRegisterInfo::canRealignStack(), llvm::PPCRegisterInfo::canRealignStack(), llvm::AArch64FrameLowering::canUseRedZone(), checkNumAlignedDPRCS2Regs(), combineInstructionsOverFunction(), llvm::TargetFrameLowering::determineCalleeSaves(), llvm::PPCFrameLowering::determineFrameLayout(), llvm::TargetOptions::DisableFramePointerElim(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::MipsAsmPrinter::EmitFunctionBodyStart(), llvm::X86FrameLowering::emitPrologue(), ExpandPowI(), llvm::X86InstrInfo::foldMemoryOperandImpl(), get64BitArgumentXMMs(), llvm::ARMBaseRegisterInfo::getCalleeSavedRegs(), llvm::InlineCostAnalysis::getInlineCost(), llvm::Inliner::getInlineThreshold(), llvm::MemoryDependenceAnalysis::getLoadLoadClobberFullWidthSize(), getMemcpyLoadsAndStores(), getMemmoveLoadsAndStores(), getMemsetStores(), llvm::ARMBaseInstrInfo::getOperandLatency(), llvm::MipsTargetLowering::getOpndList(), llvm::ARMTargetLowering::getOptimalMemOpType(), llvm::AArch64TargetLowering::getOptimalMemOpType(), llvm::PPCTargetLowering::getOptimalMemOpType(), llvm::X86TargetLowering::getOptimalMemOpType(), llvm::MipsRegisterInfo::getReservedRegs(), llvm::MipsCCState::getSpecialCallingConvForCallee(), llvm::X86TargetMachine::getSubtargetImpl(), llvm::ARMBaseTargetMachine::getSubtargetImpl(), llvm::MipsTargetMachine::getSubtargetImpl(), hasReturnsTwiceAttr(), llvm::InlineCostAnalysis::isInlineViable(), isNoReturnDef(), llvm::ARMBaseInstrInfo::isProfitableToIfCvt(), llvm::RecurrenceDescriptor::isReductionPHI(), llvm::isSafeToSpeculativelyExecute(), LowerVectorBroadcast(), llvm::MachineFunction::MachineFunction(), llvm::PPCFrameLowering::needsFP(), llvm::MipsRegisterInfo::needsStackRealignment(), llvm::X86RegisterInfo::needsStackRealignment(), llvm::ARMBaseRegisterInfo::needsStackRealignment(), llvm::PPCRegisterInfo::needsStackRealignment(), llvm::LibCallSimplifier::optimizeCall(), PerformOrCombine(), performSTORECombine(), PerformSTORECombine(), ProfitableToMerge(), llvm::Inliner::removeDeadFunctions(), removeUseSoftFloat(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::MachineFunction::shouldSplitStack(), llvm::LoopPass::skipOptnoneFunction(), llvm::FunctionPass::skipOptnoneFunction(), llvm::BasicBlockPass::skipOptnoneFunction(), llvm::tryFoldSPUpdateIntoPushPop(), llvm::ARMSubtarget::useMovt(), and WindowsRequiresStackProbe().
Definition at line 220 of file Function.h.
References llvm::AttributeSet::FunctionIndex, and llvm::AttributeSet::hasAttribute().
| bool Function::hasGC | ( | ) | const |
hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm to use during code generation.
Definition at line 379 of file Function.cpp.
References GCLock, and GCNames.
Referenced by copyAttributesFrom(), llvm::GCModuleInfo::getFunctionInfo(), getGC(), llvm::InlineFunction(), LLVMGetGC(), llvm::SelectionDAGISel::runOnMachineFunction(), shouldRewriteFunction(), and shouldRewriteStatepointsIn().
|
inline |
Check if this has any metadata.
Definition at line 571 of file Function.h.
Referenced by dropUnknownMetadata(), getAllMetadata(), getMetadata(), setMetadata(), and WriteFunction().
|
inline |
Get the personality function associated with this function.
Definition at line 132 of file Function.h.
References llvm::User::getNumOperands().
Referenced by llvm::DwarfCFIException::beginFunction(), llvm::WinException::beginFunction(), copyAttributesFrom(), llvm::WinException::endFunction(), llvm::ARMException::endFunction(), getPersonalityFn(), getSEHRegistrationNodeSize(), llvm::InlineFunction(), recoverFramePointer(), llvm::FunctionLoweringInfo::set(), and setPersonalityFn().
|
inline |
Definition at line 502 of file Function.h.
References llvm::Value::getSubclassDataFromValue().
Referenced by copyAttributesFrom(), getPrefixData(), and setPrefixData().
|
inline |
Definition at line 509 of file Function.h.
References llvm::Value::getSubclassDataFromValue().
Referenced by copyAttributesFrom(), getPrologueData(), and setPrologueData().
|
inline |
Determine if the function returns a structure through first pointer argument.
Definition at line 360 of file Function.h.
References llvm::AttributeSet::hasAttribute(), and llvm::Attribute::StructRet.
Referenced by llvm::Mangler::getNameWithPrefix(), llvm::SparcTargetLowering::getSRetArgSize(), 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 345 of file Function.h.
References llvm::AttributeSet::FunctionIndex, llvm::AttributeSet::hasAttribute(), and llvm::Attribute::UWTable.
Referenced by needsUnwindTableEntry().
|
inline |
Determine if the call is convergent.
Definition at line 334 of file Function.h.
References llvm::Attribute::Convergent, llvm::AttributeSet::FunctionIndex, and llvm::AttributeSet::hasAttribute().
| 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 900 of file Function.cpp.
References llvm::GlobalValue::hasAvailableExternallyLinkage(), llvm::GlobalValue::hasLinkOnceLinkage(), llvm::GlobalValue::hasLocalLinkage(), and llvm::Value::users().
Referenced by llvm::Inliner::removeDeadFunctions().
|
inline |
Definition at line 160 of file Function.h.
References llvm::Value::getName(), and llvm::StringRef::startswith().
Referenced by llvm::CallGraphNode::addCalledFunction(), llvm::Module::getOrInsertFunction(), llvm::TargetTransformInfoImplBase::isLoweredToCall(), isReferencingMDNode(), recalculateIntrinsicID(), SimplifyCall(), and UpdateCallGraphAfterInlining().
| bool Function::isMaterializable | ( | ) | const |
Definition at line 215 of file Function.cpp.
References llvm::GlobalObject::getGlobalObjectSubClassData().
| bool Function::isVarArg | ( | ) | const |
isVarArg - Return true if this function takes a variable number of arguments.
Definition at line 229 of file Function.cpp.
References getFunctionType(), and llvm::FunctionType::isVarArg().
Referenced by llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::X86FrameLowering::adjustForSegmentedStacks(), llvm::XCoreFunctionInfo::createLRSpillSlot(), llvm::SystemZFrameLowering::determineCalleeSaves(), llvm::XCoreFrameLowering::determineCalleeSaves(), determinePointerReadAttrs(), llvm::HexagonTargetLowering::LowerCall(), llvm::FunctionLoweringInfo::set(), and llvm::SystemZFrameLowering::spillCalleeSavedRegisters().
|
inline |
True if this function needs an unwind table.
Definition at line 354 of file Function.h.
References doesNotThrow(), and hasUWTable().
Referenced by llvm::DwarfCFIException::beginFunction(), llvm::WinException::beginFunction(), llvm::X86FrameLowering::emitEpilogue(), llvm::AArch64FrameLowering::emitPrologue(), llvm::PPCFrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), llvm::ARMException::endFunction(), llvm::AsmPrinter::needsCFIMoves(), llvm::XCoreRegisterInfo::needsFrameMoves(), and llvm::AsmPrinter::needsSEHMoves().
|
inline |
Determine if the call can access memmory only using pointers based on its arguments.
Definition at line 298 of file Function.h.
References llvm::Attribute::ArgMemOnly, llvm::AttributeSet::FunctionIndex, and llvm::AttributeSet::hasAttribute().
|
inline |
Determine if the function does not access or only reads memory.
Definition at line 287 of file Function.h.
References doesNotAccessMemory(), llvm::AttributeSet::FunctionIndex, llvm::AttributeSet::hasAttribute(), and llvm::Attribute::ReadOnly.
Referenced by HandleByValArgument().
Definition at line 390 of file Function.h.
References doesNotAccessMemory(), llvm::AttributeSet::hasAttribute(), and llvm::Attribute::ReadOnly.
| void Function::print | ( | raw_ostream & | OS, |
| AssemblyAnnotationWriter * | AAW = nullptr |
||
| ) | const |
Print the function to an output stream with an optional AssemblyAnnotationWriter.
Definition at line 3139 of file AsmWriter.cpp.
References llvm::GlobalValue::getParent().
| 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 453 of file Function.cpp.
References llvm::Value::getValueName(), llvm::GlobalValue::IntID, isIntrinsic(), lookupIntrinsicID(), and llvm::Intrinsic::not_intrinsic.
| void Function::removeAttributes | ( | unsigned | i, |
| AttributeSet | attr | ||
| ) |
removes the attributes from the list of attributes.
Definition at line 353 of file Function.cpp.
References getAttributes(), getContext(), llvm::AttributeSet::removeAttributes(), and setAttributes().
Referenced by AdjustCallerSSPLevel(), llvm::Argument::removeAttr(), and removeUseSoftFloat().
|
inline |
Remove function attributes from this function.
Definition at line 193 of file Function.h.
References llvm::AttributeSet::FunctionIndex, getContext(), llvm::AttributeSet::removeAttribute(), and setAttributes().
|
overridevirtual |
removeFromParent - This method unlinks 'this' from the containing module, but does not delete it.
Implements llvm::GlobalValue.
Definition at line 237 of file Function.cpp.
References llvm::Module::getFunctionList(), llvm::GlobalValue::getParent(), and llvm::iplist< NodeTy, Traits >::remove().
|
inline |
Set the attribute list for this Function.
Definition at line 184 of file Function.h.
Referenced by addAttribute(), addAttributes(), addDereferenceableAttr(), addDereferenceableOrNullAttr(), addFnAttr(), llvm::CloneFunctionInto(), copyAttributesFrom(), llvm::Module::getOrInsertFunction(), LLVMAddFunctionAttr(), LLVMRemoveFunctionAttr(), removeAttributes(), removeFnAttr(), RemoveNestAttribute(), and llvm::UpgradeIntrinsicFunction().
|
inline |
Definition at line 175 of file Function.h.
References llvm::Value::getSubclassDataFromValue().
Referenced by copyAttributesFrom().
|
inline |
Definition at line 329 of file Function.h.
References addFnAttr(), and llvm::Attribute::NoDuplicate.
|
inline |
Definition at line 338 of file Function.h.
References addFnAttr(), and llvm::Attribute::Convergent.
|
inline |
Definition at line 282 of file Function.h.
References addFnAttr(), and llvm::Attribute::ReadNone.
|
inline |
Definition at line 386 of file Function.h.
References addAttribute(), and llvm::Attribute::ReadNone.
|
inline |
Definition at line 370 of file Function.h.
References addAttribute(), and llvm::Attribute::NoAlias.
|
inline |
Definition at line 379 of file Function.h.
References addAttribute(), and llvm::Attribute::NoCapture.
|
inline |
Definition at line 311 of file Function.h.
References addFnAttr(), and llvm::Attribute::NoReturn.
|
inline |
Definition at line 320 of file Function.h.
References addFnAttr(), and llvm::Attribute::NoUnwind.
| void Function::setEntryCount | ( | uint64_t | Count | ) |
Set the entry count for this function.
Definition at line 985 of file Function.cpp.
References llvm::MDBuilder::createFunctionEntryCount(), getContext(), llvm::LLVMContext::MD_prof, and setMetadata().
| void Function::setGC | ( | const char * | Str | ) |
Definition at line 390 of file Function.cpp.
References GCLock, GCNamePool, GCNames, and llvm::StringPool::intern().
Referenced by copyAttributesFrom(), llvm::InlineFunction(), and LLVMSetGC().
|
inline |
Definition at line 349 of file Function.h.
References addFnAttr(), and llvm::Attribute::UWTable.
| void Function::setIsMaterializable | ( | bool | V | ) |
Definition at line 219 of file Function.cpp.
Referenced by dropAllReferences().
Set a particular kind of metadata attachment.
Sets the given attachment to MD, erasing it if MD is nullptr or replacing it if it already exists.
Definition at line 1191 of file Metadata.cpp.
References llvm::LLVMContextImpl::FunctionMetadata, getContext(), hasMetadata(), llvm::LLVMContext::pImpl, and llvm::SPII::Store.
Referenced by setEntryCount(), and setMetadata().
Definition at line 1210 of file Metadata.cpp.
References getContext(), hasMetadata(), and setMetadata().
|
inline |
Definition at line 302 of file Function.h.
References addFnAttr(), and llvm::Attribute::ArgMemOnly.
|
inline |
Definition at line 292 of file Function.h.
References addFnAttr(), and llvm::Attribute::ReadOnly.
|
inline |
Definition at line 394 of file Function.h.
References addAttribute(), and llvm::Attribute::ReadOnly.
| void Function::setPersonalityFn | ( | Constant * | C | ) |
Definition at line 1001 of file Function.cpp.
References hasPersonalityFn(), and llvm::User::setFunctionNumOperands().
Referenced by llvm::CloneModule(), copyAttributesFrom(), dropAllReferences(), and llvm::InlineFunction().
| void Function::setPrefixData | ( | Constant * | PrefixData | ) |
Definition at line 935 of file Function.cpp.
References llvm::ReturnInst::Create(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::erase(), getContext(), llvm::Value::getSubclassDataFromValue(), hasPrefixData(), llvm::LLVMContext::pImpl, llvm::LLVMContextImpl::PrefixDataMap, and llvm::User::setOperand().
Referenced by copyAttributesFrom(), and dropAllReferences().
| void Function::setPrologueData | ( | Constant * | PrologueData | ) |
Definition at line 964 of file Function.cpp.
References llvm::ReturnInst::Create(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::erase(), getContext(), llvm::Value::getSubclassDataFromValue(), hasPrologueData(), llvm::LLVMContext::pImpl, llvm::LLVMContextImpl::PrologueDataMap, and llvm::User::setOperand().
Referenced by copyAttributesFrom(), and dropAllReferences().
|
inline |
Definition at line 462 of file Function.h.
References llvm::iplist< NodeTy, Traits >::size().
Referenced by llvm::removeUnreachableBlocks(), llvm::GraphTraits< Function * >::size(), and llvm::GraphTraits< const Function * >::size().
| void llvm::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.
Referenced by LLVMViewFunctionCFG().
| void llvm::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.
Referenced by LLVMViewFunctionCFGOnly().
|
friend |
Definition at line 93 of file Function.h.
1.8.6