LLVM API Documentation
#include <Function.h>
Definition at line 71 of file Function.h.
Definition at line 80 of file Function.h.
Definition at line 73 of file Function.h.
Definition at line 74 of file Function.h.
Definition at line 81 of file Function.h.
Definition at line 78 of file Function.h.
Definition at line 77 of file Function.h.
Definition at line 268 of file Function.cpp.
References llvm::iplist< NodeTy, Traits >::clear(), clearGC(), dropAllReferences(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::erase(), getContext(), llvm::Value::getValueName(), llvm::LLVMContextImpl::IntrinsicIDCache, isIntrinsic(), and llvm::LLVMContext::pImpl.
void Function::addAttribute | ( | unsigned | i, |
Attribute::AttrKind | attr | ||
) |
adds the attribute to the list of attributes.
Definition at line 333 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 339 of file Function.cpp.
References llvm::AttributeSet::addAttributes(), getAttributes(), getContext(), and setAttributes().
Referenced by llvm::Argument::addAttr(), LLVMAddTargetDependentFunctionAttr(), and removeUseSoftFloat().
void llvm::Function::addFnAttr | ( | Attribute::AttrKind | N | ) | [inline] |
Add function attributes to this function.
Definition at line 176 of file Function.h.
References llvm::AttributeSet::addAttribute(), llvm::AttributeSet::FunctionIndex, getContext(), and setAttributes().
Referenced by AdjustCallerSSPLevel(), assureFPCallStub(), createFPFnStub(), fixupFPReturnAndCall(), llvm::MipsOs16::runOnModule(), setCannotDuplicate(), setDoesNotAccessMemory(), setDoesNotReturn(), setDoesNotThrow(), setHasUWTable(), and setOnlyReadsMemory().
void llvm::Function::addFnAttr | ( | StringRef | Kind | ) | [inline] |
Add function attributes to this function.
Definition at line 188 of file Function.h.
References llvm::AttributeSet::addAttribute(), llvm::AttributeSet::FunctionIndex, getContext(), and setAttributes().
void llvm::Function::addFnAttr | ( | StringRef | Kind, |
StringRef | Value | ||
) | [inline] |
Definition at line 193 of file Function.h.
References llvm::AttributeSet::addAttribute(), llvm::AttributeSet::FunctionIndex, getContext(), and setAttributes().
arg_iterator llvm::Function::arg_begin | ( | ) | [inline] |
Definition at line 417 of file Function.h.
References llvm::iplist< NodeTy, Traits >::begin().
Referenced by AddAliasScopeMetadata(), AddFastCallStdCallSuffix(), args(), llvm::Interpreter::callFunction(), llvm::CloneAndPruneFunctionInto(), llvm::CloneFunction(), llvm::CloneFunctionInto(), llvm::CloneModule(), determinePointerReadAttrs(), EnsureFPIntrinsicsExist(), llvm::Argument::getArgNo(), llvm::objcarc::GetFunctionClass(), llvm::SparcTargetLowering::getSRetArgSize(), HasNestArgument(), llvm::ValueEnumerator::incorporateFunction(), llvm::InlineFunction(), isDynamicConstant(), LLVMGetFirstParam(), LLVMGetLastParam(), LLVMGetParams(), LLVMGetPreviousParam(), llvm::FastISel::lowerArguments(), llvm::NVPTXTargetLowering::LowerFormalArguments(), llvm::AssemblyWriter::printFunction(), and UpgradeIntrinsicFunction1().
const_arg_iterator llvm::Function::arg_begin | ( | ) | const [inline] |
Definition at line 421 of file Function.h.
References llvm::iplist< NodeTy, Traits >::begin().
bool Function::arg_empty | ( | ) | const |
Definition at line 300 of file Function.cpp.
References getFunctionType(), and llvm::FunctionType::getNumParams().
arg_iterator llvm::Function::arg_end | ( | ) | [inline] |
Definition at line 425 of file Function.h.
References llvm::iplist< NodeTy, Traits >::end().
Referenced by AddAliasScopeMetadata(), AddFastCallStdCallSuffix(), args(), llvm::Interpreter::callFunction(), llvm::CloneAndPruneFunctionInto(), llvm::CloneFunction(), llvm::CloneFunctionInto(), determinePointerReadAttrs(), EnsureFPIntrinsicsExist(), llvm::objcarc::GetFunctionClass(), HasNestArgument(), llvm::ValueEnumerator::incorporateFunction(), llvm::InlineFunction(), LLVMGetFirstParam(), LLVMGetLastParam(), LLVMGetNextParam(), LLVMGetParams(), llvm::FastISel::lowerArguments(), llvm::NVPTXTargetLowering::LowerFormalArguments(), and llvm::AssemblyWriter::printFunction().
const_arg_iterator llvm::Function::arg_end | ( | ) | const [inline] |
Definition at line 429 of file Function.h.
References llvm::iplist< NodeTy, Traits >::end().
size_t Function::arg_size | ( | ) | const |
Definition at line 297 of file Function.cpp.
References getFunctionType(), and llvm::FunctionType::getNumParams().
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), llvm::Interpreter::callFunction(), llvm::InlineFunction(), needsFPStubFromParams(), UpgradeIntrinsicFunction1(), and whichFPParamVariantNeeded().
iterator_range<arg_iterator> llvm::Function::args | ( | ) | [inline] |
Definition at line 434 of file Function.h.
References arg_begin(), and arg_end().
Referenced by buildSetsFrom(), and llvm::CloneFunctionInto().
iterator_range<const_arg_iterator> llvm::Function::args | ( | ) | const [inline] |
Definition at line 438 of file Function.h.
References arg_begin(), and arg_end().
const BasicBlock& llvm::Function::back | ( | ) | const [inline] |
Definition at line 411 of file Function.h.
References llvm::iplist< NodeTy, Traits >::back().
Referenced by llvm::InlineFunction().
BasicBlock& llvm::Function::back | ( | ) | [inline] |
Definition at line 412 of file Function.h.
References llvm::iplist< NodeTy, Traits >::back().
iterator llvm::Function::begin | ( | ) | [inline] |
Definition at line 402 of file Function.h.
References llvm::iplist< NodeTy, Traits >::begin().
Referenced by llvm::Interpreter::callFunction(), CloneAliasScopeMetadata(), llvm::CloneAndPruneFunctionInto(), llvm::CloneFunctionInto(), cxxDtorIsEmpty(), llvm::InstCombiner::DoOneIteration(), 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(), mergeEmptyReturnBlocks(), llvm::GraphTraits< BlockFrequencyInfo * >::nodes_begin(), llvm::GraphTraits< Function * >::nodes_begin(), llvm::GraphTraits< const Function * >::nodes_begin(), llvm::BranchProbabilityInfo::print(), llvm::SparseSolver::Print(), llvm::AssemblyWriter::printFunction(), llvm::removeUnreachableBlocks(), llvm::NVPTXLowerAggrCopies::runOnFunction(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::Inliner::runOnSCC(), llvm::FunctionLoweringInfo::set(), SplitCriticalSideEffectEdges(), llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit(), WriteFunction(), and WriteMetadataAttachment().
const_iterator llvm::Function::begin | ( | ) | const [inline] |
Definition at line 403 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 801 of file Function.cpp.
References llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::hasFnAttr(), I, llvm::inst_begin(), llvm::inst_end(), and llvm::Attribute::ReturnsTwice.
Referenced by llvm::SelectionDAGISel::runOnMachineFunction().
bool llvm::Function::cannotDuplicate | ( | ) | const [inline] |
Determine if the call cannot be duplicated.
Definition at line 280 of file Function.h.
References llvm::AttributeSet::FunctionIndex, llvm::AttributeSet::hasAttribute(), and llvm::Attribute::NoDuplicate.
static bool llvm::Function::classof | ( | const Value * | V | ) | [inline, static] |
Methods for support type inquiry through isa, cast, and dyn_cast:
Reimplemented from llvm::GlobalObject.
Definition at line 470 of file Function.h.
References llvm::Value::FunctionVal, and llvm::Value::getValueID().
void Function::clearGC | ( | ) |
Definition at line 379 of file Function.cpp.
References llvm::StringPool::empty(), GCLock, GCNamePool, and GCNames.
Referenced by copyAttributesFrom(), LLVMSetGC(), and ~Function().
void Function::copyAttributesFrom | ( | const GlobalValue * | Src | ) | [override, virtual] |
copyAttributesFrom - copy all additional attributes (those not needed to create a Function) from the Function Src to this one.
Reimplemented from llvm::GlobalObject.
Definition at line 396 of file Function.cpp.
References clearGC(), getAttributes(), getCallingConv(), getGC(), getPrefixData(), hasGC(), hasPrefixData(), setAttributes(), setCallingConv(), setGC(), and setPrefixData().
Referenced by llvm::CloneFunctionInto(), and llvm::CloneModule().
static Function* llvm::Function::Create | ( | FunctionType * | Ty, |
LinkageTypes | Linkage, | ||
const Twine & | N = "" , |
||
Module * | M = nullptr |
||
) | [inline, static] |
Definition at line 128 of file Function.h.
Referenced by llvm::CloneFunction(), llvm::CloneModule(), llvm::Module::getOrInsertFunction(), llvm::JumpInstrTables::insertEntry(), LLVMAddFunction(), setPrefixData(), and UpgradeIntrinsicFunction1().
void llvm::Function::deleteBody | ( | ) | [inline] |
deleteBody - This method deletes the body of the function, and converts the linkage to external.
Definition at line 350 of file Function.h.
References dropAllReferences(), llvm::GlobalValue::ExternalLinkage, and llvm::GlobalValue::setLinkage().
Referenced by llvm::BitcodeReader::Dematerialize().
bool llvm::Function::doesNotAccessMemory | ( | ) | const [inline] |
Determine if the function does not access memory.
Definition at line 243 of file Function.h.
References llvm::AttributeSet::FunctionIndex, llvm::AttributeSet::hasAttribute(), and llvm::Attribute::ReadNone.
Referenced by onlyReadsMemory().
bool llvm::Function::doesNotAccessMemory | ( | unsigned | n | ) | const [inline] |
Definition at line 328 of file Function.h.
References llvm::AttributeSet::hasAttribute(), and llvm::Attribute::ReadNone.
bool llvm::Function::doesNotAlias | ( | unsigned | n | ) | const [inline] |
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 312 of file Function.h.
References llvm::AttributeSet::hasAttribute(), and llvm::Attribute::NoAlias.
bool llvm::Function::doesNotCapture | ( | unsigned | n | ) | const [inline] |
Determine if the parameter can be captured.
n | The parameter to check. 1 is the first parameter, 0 is the return |
Definition at line 321 of file Function.h.
References llvm::AttributeSet::hasAttribute(), and llvm::Attribute::NoCapture.
bool llvm::Function::doesNotReturn | ( | ) | const [inline] |
Determine if the function cannot return.
Definition at line 262 of file Function.h.
References llvm::AttributeSet::FunctionIndex, llvm::AttributeSet::hasAttribute(), and llvm::Attribute::NoReturn.
bool llvm::Function::doesNotThrow | ( | ) | const [inline] |
Determine if the function cannot unwind.
Definition at line 271 of file Function.h.
References llvm::AttributeSet::FunctionIndex, llvm::AttributeSet::hasAttribute(), and llvm::Attribute::NoUnwind.
Referenced by llvm::EHStreamer::callToNoUnwindFunction(), 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.
Reimplemented from llvm::User.
Definition at line 320 of file Function.cpp.
References llvm::iplist< NodeTy, Traits >::begin(), begin(), llvm::iplist< NodeTy, Traits >::empty(), end(), I, and setPrefixData().
Referenced by deleteBody(), llvm::Module::dropAllReferences(), and ~Function().
bool llvm::Function::empty | ( | ) | const [inline] |
Definition at line 408 of file Function.h.
References llvm::iplist< NodeTy, Traits >::empty().
Referenced by llvm::optimizeGlobalCtorsList().
iterator llvm::Function::end | ( | ) | [inline] |
Definition at line 404 of file Function.h.
References llvm::iplist< NodeTy, Traits >::end().
Referenced by CloneAliasScopeMetadata(), llvm::CloneAndPruneFunctionInto(), llvm::CloneFunctionInto(), cxxDtorIsEmpty(), llvm::InstCombiner::DoOneIteration(), dropAllReferences(), llvm::dumpBlock(), fixupFPReturnAndCall(), fixupLineNumbers(), functionHasLines(), getCommonReturnValue(), HandleInlinedInvoke(), llvm::ValueEnumerator::incorporateFunction(), IncorporateFunctionInfoGlobalBBIDs(), llvm::InlineFunction(), llvm::InlineCostAnalysis::isInlineViable(), iterativelyFlattenCFG(), iterativelySimplifyCFG(), LLVMGetBasicBlocks(), LLVMGetFirstBasicBlock(), LLVMGetLastBasicBlock(), LLVMGetNextBasicBlock(), mergeEmptyReturnBlocks(), llvm::GraphTraits< BlockFrequencyInfo * >::nodes_end(), llvm::GraphTraits< Function * >::nodes_end(), llvm::GraphTraits< const Function * >::nodes_end(), placeSplitBlockCarefully(), llvm::BranchProbabilityInfo::print(), llvm::SparseSolver::Print(), llvm::AssemblyWriter::printFunction(), llvm::removeUnreachableBlocks(), llvm::NVPTXLowerAggrCopies::runOnFunction(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::Inliner::runOnSCC(), llvm::FunctionLoweringInfo::set(), SplitCriticalSideEffectEdges(), llvm::UnrollRuntimeLoopProlog(), llvm::InstVisitor< ObjectSizeOffsetVisitor, SizeOffsetType >::visit(), WriteFunction(), and WriteMetadataAttachment().
const_iterator llvm::Function::end | ( | ) | const [inline] |
Definition at line 405 of file Function.h.
References llvm::iplist< NodeTy, Traits >::end().
void Function::eraseFromParent | ( | ) | [override, virtual] |
eraseFromParent - This method unlinks 'this' from the containing module and deletes it.
Implements llvm::GlobalValue.
Definition at line 236 of file Function.cpp.
References llvm::iplist< NodeTy, Traits >::erase(), llvm::Module::getFunctionList(), and llvm::GlobalValue::getParent().
Referenced by INITIALIZE_PASS(), and llvm::UpgradeCallsToIntrinsic().
const BasicBlock& llvm::Function::front | ( | ) | const [inline] |
Definition at line 409 of file Function.h.
References llvm::iplist< NodeTy, Traits >::front().
Referenced by getEntryBlock(), llvm::IntervalIterator< NodeTy, OrigContainer_t, GT, IGT >::IntervalIterator(), and llvm::AllocaInst::isStaticAlloca().
BasicBlock& llvm::Function::front | ( | ) | [inline] |
Definition at line 410 of file Function.h.
References llvm::iplist< NodeTy, Traits >::front().
const ArgumentListType& llvm::Function::getArgumentList | ( | ) | const [inline] |
Get the underlying elements of the Function... the basic block list is empty for external functions.
Definition at line 369 of file Function.h.
Referenced by llvm::Argument::Argument().
ArgumentListType& llvm::Function::getArgumentList | ( | ) | [inline] |
Definition at line 373 of file Function.h.
AttributeSet llvm::Function::getAttributes | ( | ) | const [inline] |
Return the attribute list for this Function.
Definition at line 170 of file Function.h.
Referenced by addAttribute(), addAttributes(), AddFastCallStdCallSuffix(), AdjustCallerSSPLevel(), llvm::AMDGPUMachineFunction::AMDGPUMachineFunction(), llvm::AArch64FrameLowering::canUseRedZone(), checkNumAlignedDPRCS2Regs(), llvm::CloneFunctionInto(), copyAttributesFrom(), llvm::PPCFrameLowering::determineFrameLayout(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::PPCTargetLowering::emitEHSjLjSetJmp(), llvm::XCoreFrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), ExpandPowI(), get64BitArgumentXMMs(), llvm::Inliner::getInlineThreshold(), llvm::MemoryDependenceAnalysis::getLoadLoadClobberFullWidthSize(), getMemcpyLoadsAndStores(), getMemmoveLoadsAndStores(), getMemsetStores(), llvm::ARMBaseInstrInfo::getOperandLatency(), llvm::ARMTargetLowering::getOptimalMemOpType(), llvm::AArch64TargetLowering::getOptimalMemOpType(), 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::ValueEnumerator::incorporateFunction(), insertSinCosCall(), llvm::InlineCostAnalysis::isInlineViable(), llvm::TargetLowering::isInTailCallPosition(), LLVMAddFunctionAttr(), LLVMGetAttribute(), LLVMGetFunctionAttr(), LLVMRemoveFunctionAttr(), llvm::NVPTXTargetLowering::LowerFormalArguments(), llvm::MachineFunction::MachineFunction(), llvm::PPCFrameLowering::needsFP(), llvm::PPCRegisterInfo::needsStackRealignment(), llvm::ARMBaseRegisterInfo::needsStackRealignment(), llvm::Argument::onlyReadsMemory(), PerformOrCombine(), performSTORECombine(), PerformSTORECombine(), llvm::AssemblyWriter::printFunction(), ProfitableToMerge(), removeAttributes(), llvm::Inliner::removeDeadFunctions(), RemoveNestAttribute(), llvm::MipsTargetMachine::resetSubtarget(), llvm::returnTypeIsEligibleForTailCall(), llvm::InstCombiner::runOnFunction(), llvm::StackProtector::runOnFunction(), llvm::FunctionLoweringInfo::set(), llvm::tryFoldSPUpdateIntoPushPop(), llvm::ARMSubtarget::useMovt(), and llvm::InstCombiner::visitFPTrunc().
const BasicBlockListType& llvm::Function::getBasicBlockList | ( | ) | const [inline] |
Definition at line 381 of file Function.h.
Referenced by buildGraphFrom(), llvm::CloneAndPruneFunctionInto(), 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().
BasicBlockListType& llvm::Function::getBasicBlockList | ( | ) | [inline] |
Definition at line 382 of file Function.h.
CallingConv::ID llvm::Function::getCallingConv | ( | ) | const [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 161 of file Function.h.
References llvm::Value::getSubclassDataFromValue().
Referenced by copyAttributesFrom(), llvm::ARMFrameLowering::emitEpilogue(), llvm::PPCFrameLowering::emitEpilogue(), llvm::ARMFrameLowering::emitPrologue(), llvm::MSP430RegisterInfo::getCalleeSavedRegs(), llvm::AArch64RegisterInfo::getCalleeSavedRegs(), llvm::ARMBaseRegisterInfo::getCalleeSavedRegs(), llvm::Mangler::getNameWithPrefix(), GetScratchRegister(), llvm::HexagonTargetLowering::IsEligibleForTailCallOptimization(), llvm::isKernelFunction(), isProfitableToMakeFastCC(), llvm::AssemblyWriter::printFunction(), and llvm::FunctionLoweringInfo::set().
LLVMContext & Function::getContext | ( | ) | const |
getContext - Return a pointer to the LLVMContext associated with this function, or NULL if this function is not bound to a context yet.
Reimplemented from llvm::Value.
Definition at line 216 of file Function.cpp.
References llvm::Type::getContext(), and llvm::GlobalValue::getType().
Referenced by AddAliasScopeMetadata(), llvm::Argument::addAttr(), addAttribute(), addAttributes(), addFnAttr(), AdjustCallerSSPLevel(), llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::DwarfDebug::beginFunction(), CloneAliasScopeMetadata(), llvm::CloneFunctionInto(), createFPFnStub(), duplicateCPV(), llvm::SIRegisterInfo::eliminateFrameIndex(), emitAnalysis(), llvm::NVPTXAsmPrinter::emitLineNumberAsDotLoc(), llvm::Thumb2RegisterInfo::emitLoadConstPool(), llvm::Thumb1RegisterInfo::emitLoadConstPool(), llvm::ARMBaseRegisterInfo::emitLoadConstPool(), llvm::FastISel::fastEmit_ri_(), llvm::LexicalScopes::findInlinedScope(), llvm::LexicalScopes::findLexicalScope(), llvm::BlockAddress::get(), llvm::ScalarEvolution::getContext(), getIntrinsicID(), getPrefixData(), llvm::SelectionDAG::init(), INITIALIZE_PASS(), insertFastDiv(), llvm::isFreeCall(), LLVMAddFunctionAttr(), LLVMAddTargetDependentFunctionAttr(), LLVMRemoveFunctionAttr(), llvm::XCoreInstrInfo::loadImmediate(), llvm::SIInstrInfo::loadRegFromStackSlot(), llvm::BlockAddress::lookup(), llvm::NVPTXTargetLowering::LowerCall(), llvm::NVPTXTargetLowering::LowerFormalArguments(), llvm::NVPTXTargetLowering::LowerReturn(), printDebugLoc(), llvm::Argument::removeAttr(), removeAttributes(), removeFnAttr(), RemoveNestAttribute(), removeUseSoftFloat(), llvm::legacy::FunctionPassManagerImpl::run(), llvm::FunctionPassManager::run(), llvm::ExecutionEngine::runFunctionAsMain(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::LPPassManager::runOnFunction(), llvm::InstCombiner::runOnFunction(), llvm::PEI::runOnMachineFunction(), llvm::Inliner::runOnSCC(), llvm::FastISel::selectExtractValue(), llvm::FunctionLoweringInfo::set(), setPrefixData(), llvm::SIInstrInfo::storeRegToStackSlot(), llvm::UnrollLoop(), llvm::UpgradeIntrinsicFunction(), UpgradeIntrinsicFunction1(), UpgradeSSE41Function(), and ~Function().
uint64_t llvm::Function::getDereferenceableBytes | ( | unsigned | i | ) | const [inline] |
Extract the number of dereferenceable bytes for a call or parameter (0=unknown).
Definition at line 238 of file Function.h.
References llvm::AttributeSet::getDereferenceableBytes().
Referenced by llvm::Argument::getDereferenceableBytes().
const BasicBlock& llvm::Function::getEntryBlock | ( | ) | const [inline] |
Definition at line 387 of file Function.h.
References front().
Referenced by llvm::CloneAndPruneFunctionInto(), llvm::CloneBasicBlock(), CreatePrologue(), cxxDtorIsEmpty(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), llvm::FindFunctionBackedges(), llvm::MemoryDependenceAnalysis::getDependency(), llvm::GraphTraits< Function * >::getEntryNode(), llvm::GraphTraits< const Function * >::getEntryNode(), llvm::GraphTraits< Inverse< Function * > >::getEntryNode(), llvm::GraphTraits< Inverse< const Function * > >::getEntryNode(), getFunctionEntryDebugLocation(), llvm::MemoryDependenceAnalysis::getNonLocalCallDependency(), llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), llvm::InlineFunction(), insertSinCosCall(), isEmptyFunction(), llvm::SelectionDAGBuilder::isExportableFromCurrentBlock(), llvm::isPotentiallyReachable(), llvm::MergeBasicBlockIntoOnlyPred(), NegateValue(), llvm::AssemblyWriter::printBasicBlock(), llvm::RegionInfo::recalculate(), llvm::BranchProbabilityInfo::runOnFunction(), llvm::BasicBlockPass::skipOptnoneFunction(), llvm::SparseSolver::Solve(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), TryToSinkInstruction(), ValueDominatesPHI(), and llvm::InstCombiner::visitAllocaInst().
BasicBlock& llvm::Function::getEntryBlock | ( | ) | [inline] |
Definition at line 388 of file Function.h.
References front().
Attribute llvm::Function::getFnAttribute | ( | Attribute::AttrKind | Kind | ) | const [inline] |
Return the attribute for the given attribute kind.
Definition at line 208 of file Function.h.
References llvm::AttributeSet::FunctionIndex, and llvm::AttributeSet::getAttribute().
Referenced by llvm::NVPTXTargetLowering::allowFMA(), llvm::ARMBaseRegisterInfo::getCalleeSavedRegs(), and LowerInterruptReturn().
Attribute llvm::Function::getFnAttribute | ( | StringRef | Kind | ) | const [inline] |
Definition at line 211 of file Function.h.
References llvm::AttributeSet::FunctionIndex, and llvm::AttributeSet::getAttribute().
FunctionType * Function::getFunctionType | ( | ) | const |
Definition at line 220 of file Function.cpp.
References llvm::SequentialType::getElementType(), and llvm::GlobalValue::getType().
Referenced by arg_empty(), arg_size(), assureFPCallStub(), llvm::Interpreter::callExternalFunction(), llvm::Interpreter::callFunction(), llvm::CloneFunction(), createFPFnStub(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::ARMTargetLowering::emitStoreConditional(), FindCXAAtExit(), llvm::SimplifyFortifiedLibCalls::fold(), getAllocationData(), llvm::Mangler::getNameWithPrefix(), getReturnType(), llvm::InlineFunction(), llvm::JumpInstrTables::insertEntry(), llvm::isFreeCall(), isMemsetPattern16(), isTrigLibCall(), isVarArg(), lookupFunction(), llvm::HexagonTargetLowering::LowerCall(), llvm::SITargetLowering::LowerFormalArguments(), needsFPStubFromParams(), llvm::AssemblyWriter::printFunction(), llvm::Interpreter::runFunction(), llvm::MCJIT::runFunction(), llvm::ExecutionEngine::runFunctionAsMain(), UpgradeSSE41Function(), UpgradeX86IntrinsicsWith8BitMask(), and whichFPParamVariantNeeded().
const char * Function::getGC | ( | ) | const |
Definition at line 364 of file Function.cpp.
References GCLock, and hasGC().
Referenced by copyAttributesFrom(), llvm::GCModuleInfo::getFunctionInfo(), llvm::InlineFunction(), LLVMGetGC(), and llvm::AssemblyWriter::printFunction().
unsigned Function::getIntrinsicID | ( | ) | const |
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. Results are cached in the LLVM context, subsequent requests for the same ID return results much faster from the cache.
Definition at line 420 of file Function.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::count(), getContext(), llvm::Value::getValueName(), llvm::tgtok::Id, llvm::LLVMContextImpl::IntrinsicIDCache, isIntrinsic(), and llvm::LLVMContext::pImpl.
Referenced by llvm::canConstantFoldCallTo(), llvm::ConstantFoldCall(), llvm::IntrinsicInst::getIntrinsicID(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::FastISel::selectInstruction(), SimplifyCall(), llvm::UpgradeIntrinsicCall(), llvm::UpgradeIntrinsicFunction(), llvm::Interpreter::visitCallSite(), and llvm::InstCombiner::visitFPTrunc().
unsigned llvm::Function::getParamAlignment | ( | unsigned | i | ) | const [inline] |
Extract the alignment for a call or parameter (0=unknown).
Definition at line 232 of file Function.h.
References llvm::AttributeSet::getParamAlignment().
Referenced by llvm::Argument::getParamAlignment(), and llvm::InlineFunction().
Constant * Function::getPrefixData | ( | ) | const |
Definition at line 812 of file Function.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), getContext(), hasPrefixData(), llvm::LLVMContext::pImpl, and llvm::LLVMContextImpl::PrefixDataMap.
Referenced by copyAttributesFrom(), llvm::AsmPrinter::EmitFunctionHeader(), and llvm::AssemblyWriter::printFunction().
Type * Function::getReturnType | ( | ) | const |
Definition at line 228 of file Function.cpp.
References getFunctionType(), and llvm::FunctionType::getReturnType().
Referenced by assureFPCallStub(), llvm::Interpreter::callFunction(), llvm::ConstantFoldCall(), llvm::IRBuilderBase::getCurrentFunctionReturnType(), llvm::InlineFunction(), llvm::NVPTXTargetLowering::LowerReturn(), needsFPReturnHelper(), NumRetVals(), llvm::AssemblyWriter::printFunction(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::FastISel::selectStackmap(), llvm::FunctionLoweringInfo::set(), and UpgradeIntrinsicFunction1().
static iplist<Argument> Function::* llvm::Function::getSublistAccess | ( | Argument * | ) | [inline, static] |
Definition at line 377 of file Function.h.
static iplist<BasicBlock> Function::* llvm::Function::getSublistAccess | ( | BasicBlock * | ) | [inline, static] |
Definition at line 383 of file Function.h.
ValueSymbolTable& llvm::Function::getValueSymbolTable | ( | ) | [inline] |
getSymbolTable() - Return the symbol table...
Definition at line 395 of file Function.h.
Referenced by llvm::ilist_traits< BasicBlock >::getSymTab(), llvm::ilist_traits< Argument >::getSymTab(), and WriteFunction().
const ValueSymbolTable& llvm::Function::getValueSymbolTable | ( | ) | const [inline] |
Definition at line 396 of file Function.h.
bool Function::hasAddressTaken | ( | const User ** | PutOffender = nullptr | ) | const |
hasAddressTaken - returns true if there are any uses of this function other than direct calls or invokes to it, or blockaddress expressions. Optionally passes back an offending user for diagnostic purposes.
hasAddressTaken - returns true if there are any uses of this function other than direct calls or invokes to it.
Definition at line 771 of file Function.cpp.
References llvm::Value::uses().
bool llvm::Function::hasFnAttribute | ( | Attribute::AttrKind | Kind | ) | const [inline] |
Return true if the function has the attribute.
Definition at line 200 of file Function.h.
References llvm::AttributeSet::FunctionIndex, and llvm::AttributeSet::hasAttribute().
Referenced by llvm::NVPTXTargetLowering::allowFMA(), attributeMatches(), llvm::PPCRegisterInfo::canRealignStack(), llvm::ARMBaseRegisterInfo::canRealignStack(), llvm::TargetOptions::DisableFramePointerElim(), llvm::ARMBaseRegisterInfo::getCalleeSavedRegs(), llvm::InlineCostAnalysis::getInlineCost(), llvm::MipsTargetLowering::getOpndList(), llvm::MipsRegisterInfo::getReservedRegs(), hasReturnsTwiceAttr(), llvm::isSafeToSpeculativelyExecute(), llvm::MachineFunction::MachineFunction(), removeUseSoftFloat(), llvm::TargetMachine::resetTargetOptions(), llvm::PEI::runOnMachineFunction(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::Mips16HardFloat::runOnModule(), llvm::JumpInstrTables::runOnModule(), llvm::MachineFunction::shouldSplitStack(), llvm::LoopPass::skipOptnoneFunction(), llvm::FunctionPass::skipOptnoneFunction(), and llvm::BasicBlockPass::skipOptnoneFunction().
bool llvm::Function::hasFnAttribute | ( | StringRef | Kind | ) | const [inline] |
Definition at line 203 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 359 of file Function.cpp.
References GCLock, and GCNames.
Referenced by copyAttributesFrom(), llvm::GCModuleInfo::getFunctionInfo(), getGC(), llvm::InlineFunction(), LLVMGetGC(), llvm::AssemblyWriter::printFunction(), and llvm::SelectionDAGISel::runOnMachineFunction().
bool llvm::Function::hasPrefixData | ( | ) | const [inline] |
Definition at line 447 of file Function.h.
References llvm::Value::getSubclassDataFromValue().
Referenced by copyAttributesFrom(), llvm::AsmPrinter::EmitFunctionHeader(), getPrefixData(), llvm::AssemblyWriter::printFunction(), and setPrefixData().
bool llvm::Function::hasStructRetAttr | ( | ) | const [inline] |
Determine if the function returns a structure through first pointer argument.
Definition at line 305 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().
bool llvm::Function::hasUWTable | ( | ) | const [inline] |
True if the ABI mandates (or the user requested) that this function be in a unwind table.
Definition at line 290 of file Function.h.
References llvm::AttributeSet::FunctionIndex, llvm::AttributeSet::hasAttribute(), and llvm::Attribute::UWTable.
Referenced by needsUnwindTableEntry().
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 785 of file Function.cpp.
References llvm::GlobalValue::hasAvailableExternallyLinkage(), llvm::GlobalValue::hasLinkOnceLinkage(), llvm::GlobalValue::hasLocalLinkage(), and llvm::Value::users().
Referenced by llvm::Inliner::removeDeadFunctions().
bool llvm::Function::isIntrinsic | ( | ) | const [inline] |
Definition at line 156 of file Function.h.
References llvm::Value::getName(), and llvm::StringRef::startswith().
Referenced by llvm::CallGraphNode::addCalledFunction(), getIntrinsicID(), llvm::Module::getOrInsertFunction(), and ~Function().
bool Function::isVarArg | ( | ) | const |
isVarArg - Return true if this function takes a variable number of arguments.
Definition at line 224 of file Function.cpp.
References getFunctionType(), and llvm::FunctionType::isVarArg().
Referenced by llvm::X86FrameLowering::adjustForSegmentedStacks(), llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::XCoreFunctionInfo::createLRSpillSlot(), determinePointerReadAttrs(), llvm::HexagonTargetLowering::LowerCall(), llvm::SystemZFrameLowering::processFunctionBeforeCalleeSavedScan(), llvm::XCoreFrameLowering::processFunctionBeforeCalleeSavedScan(), llvm::FunctionLoweringInfo::set(), and llvm::SystemZFrameLowering::spillCalleeSavedRegisters().
bool llvm::Function::needsUnwindTableEntry | ( | ) | const [inline] |
True if this function needs an unwind table.
Definition at line 299 of file Function.h.
References doesNotThrow(), and hasUWTable().
Referenced by llvm::X86FrameLowering::emitEpilogue(), llvm::PPCFrameLowering::emitPrologue(), llvm::AArch64FrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), llvm::ARMException::endFunction(), llvm::AsmPrinter::needsCFIMoves(), llvm::XCoreRegisterInfo::needsFrameMoves(), and llvm::AsmPrinter::needsSEHMoves().
bool llvm::Function::onlyReadsMemory | ( | ) | const [inline] |
Determine if the function does not access or only reads memory.
Definition at line 252 of file Function.h.
References doesNotAccessMemory(), llvm::AttributeSet::FunctionIndex, llvm::AttributeSet::hasAttribute(), and llvm::Attribute::ReadOnly.
Referenced by HandleByValArgument().
bool llvm::Function::onlyReadsMemory | ( | unsigned | n | ) | const [inline] |
Definition at line 335 of file Function.h.
References doesNotAccessMemory(), llvm::AttributeSet::hasAttribute(), and llvm::Attribute::ReadOnly.
void Function::removeAttributes | ( | unsigned | i, |
AttributeSet | attr | ||
) |
removes the attributes from the list of attributes.
Definition at line 345 of file Function.cpp.
References getAttributes(), getContext(), llvm::AttributeSet::removeAttributes(), and setAttributes().
Referenced by AdjustCallerSSPLevel(), llvm::Argument::removeAttr(), and removeUseSoftFloat().
void llvm::Function::removeFnAttr | ( | Attribute::AttrKind | N | ) | [inline] |
Remove function attributes from this function.
Definition at line 182 of file Function.h.
References llvm::AttributeSet::FunctionIndex, getContext(), llvm::AttributeSet::removeAttribute(), and setAttributes().
void Function::removeFromParent | ( | ) | [override, virtual] |
removeFromParent - This method unlinks 'this' from the containing module, but does not delete it.
Implements llvm::GlobalValue.
Definition at line 232 of file Function.cpp.
References llvm::Module::getFunctionList(), llvm::GlobalValue::getParent(), and llvm::iplist< NodeTy, Traits >::remove().
void llvm::Function::setAttributes | ( | AttributeSet | attrs | ) | [inline] |
Set the attribute list for this Function.
Definition at line 173 of file Function.h.
Referenced by addAttribute(), addAttributes(), addFnAttr(), llvm::CloneFunctionInto(), copyAttributesFrom(), llvm::Module::getOrInsertFunction(), LLVMAddFunctionAttr(), LLVMRemoveFunctionAttr(), removeAttributes(), removeFnAttr(), RemoveNestAttribute(), and llvm::UpgradeIntrinsicFunction().
void llvm::Function::setCallingConv | ( | CallingConv::ID | CC | ) | [inline] |
Definition at line 164 of file Function.h.
References llvm::Value::getSubclassDataFromValue().
Referenced by copyAttributesFrom().
void llvm::Function::setCannotDuplicate | ( | ) | [inline] |
Definition at line 284 of file Function.h.
References addFnAttr(), and llvm::Attribute::NoDuplicate.
void llvm::Function::setDoesNotAccessMemory | ( | ) | [inline] |
Definition at line 247 of file Function.h.
References addFnAttr(), and llvm::Attribute::ReadNone.
void llvm::Function::setDoesNotAccessMemory | ( | unsigned | n | ) | [inline] |
Definition at line 331 of file Function.h.
References addAttribute(), and llvm::Attribute::ReadNone.
void llvm::Function::setDoesNotAlias | ( | unsigned | n | ) | [inline] |
Definition at line 315 of file Function.h.
References addAttribute(), and llvm::Attribute::NoAlias.
void llvm::Function::setDoesNotCapture | ( | unsigned | n | ) | [inline] |
Definition at line 324 of file Function.h.
References addAttribute(), and llvm::Attribute::NoCapture.
void llvm::Function::setDoesNotReturn | ( | ) | [inline] |
Definition at line 266 of file Function.h.
References addFnAttr(), and llvm::Attribute::NoReturn.
void llvm::Function::setDoesNotThrow | ( | ) | [inline] |
Definition at line 275 of file Function.h.
References addFnAttr(), and llvm::Attribute::NoUnwind.
void Function::setGC | ( | const char * | Str | ) |
Definition at line 370 of file Function.cpp.
References GCLock, GCNamePool, GCNames, and llvm::StringPool::intern().
Referenced by copyAttributesFrom(), llvm::InlineFunction(), and LLVMSetGC().
void llvm::Function::setHasUWTable | ( | ) | [inline] |
Definition at line 294 of file Function.h.
References addFnAttr(), and llvm::Attribute::UWTable.
void llvm::Function::setOnlyReadsMemory | ( | ) | [inline] |
Definition at line 257 of file Function.h.
References addFnAttr(), and llvm::Attribute::ReadOnly.
void llvm::Function::setOnlyReadsMemory | ( | unsigned | n | ) | [inline] |
Definition at line 339 of file Function.h.
References addAttribute(), and llvm::Attribute::ReadOnly.
void Function::setPrefixData | ( | Constant * | PrefixData | ) |
Definition at line 820 of file Function.cpp.
References Create(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::erase(), getContext(), llvm::Value::getSubclassDataFromValue(), hasPrefixData(), llvm::LLVMContext::pImpl, llvm::LLVMContextImpl::PrefixDataMap, and llvm::User::setOperand().
Referenced by copyAttributesFrom(), and dropAllReferences().
size_t llvm::Function::size | ( | ) | const [inline] |
Definition at line 407 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 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 154 of file CFGPrinter.cpp.
References llvm::Value::getName(), and llvm::ViewGraph().
Referenced by LLVMViewFunctionCFGOnly().
friend class SymbolTableListTraits< Function, Module > [friend] |
Definition at line 96 of file Function.h.