LLVM API Documentation
#include <Function.h>


Public Types | |
| typedef iplist< Argument > | ArgumentListType |
| typedef iplist< BasicBlock > | BasicBlockListType |
| typedef BasicBlockListType::iterator | iterator |
| typedef BasicBlockListType::const_iterator | const_iterator |
| typedef ArgumentListType::iterator | arg_iterator |
| typedef ArgumentListType::const_iterator | const_arg_iterator |
Public Member Functions | |
| ~Function () | |
| Type * | getReturnType () const |
| FunctionType * | getFunctionType () const |
| LLVMContext & | getContext () const |
| bool | isVarArg () const |
| unsigned | getIntrinsicID () const LLVM_READONLY |
| bool | isIntrinsic () const |
| CallingConv::ID | getCallingConv () const |
| void | setCallingConv (CallingConv::ID CC) |
| const AttrListPtr & | getAttributes () const |
| void | setAttributes (const AttrListPtr &attrs) |
| bool | hasFnAttr (Attributes N) const |
| hasFnAttr - Return true if this function has the given attribute. | |
| void | addFnAttr (Attributes N) |
| void | removeFnAttr (Attributes N) |
| bool | hasGC () const |
| const char * | getGC () const |
| void | setGC (const char *Str) |
| void | clearGC () |
| bool | paramHasAttr (unsigned i, Attributes attr) const |
| Determine whether the function has the given attribute. | |
| void | addAttribute (unsigned i, Attributes attr) |
| addAttribute - adds the attribute to the list of attributes. | |
| void | removeAttribute (unsigned i, Attributes attr) |
| removeAttribute - removes the attribute from the list of attributes. | |
| unsigned | getParamAlignment (unsigned i) const |
| Extract the alignment for a call or parameter (0=unknown). | |
| bool | doesNotAccessMemory () const |
| Determine if the function does not access memory. | |
| void | setDoesNotAccessMemory (bool DoesNotAccessMemory=true) |
| bool | onlyReadsMemory () const |
| Determine if the function does not access or only reads memory. | |
| void | setOnlyReadsMemory (bool OnlyReadsMemory=true) |
| bool | doesNotReturn () const |
| Determine if the function cannot return. | |
| void | setDoesNotReturn (bool DoesNotReturn=true) |
| bool | doesNotThrow () const |
| Determine if the function cannot unwind. | |
| void | setDoesNotThrow (bool DoesNotThrow=true) |
| bool | hasUWTable () const |
| True if the ABI mandates (or the user requested) that this function be in a unwind table. | |
| void | setHasUWTable (bool HasUWTable=true) |
| bool | needsUnwindTableEntry () const |
| True if this function needs an unwind table. | |
| bool | hasStructRetAttr () const |
| Determine if the function returns a structure through first pointer argument. | |
| bool | doesNotAlias (unsigned n) const |
| Determine if the parameter does not alias other parameters. | |
| void | setDoesNotAlias (unsigned n, bool DoesNotAlias=true) |
| bool | doesNotCapture (unsigned n) const |
| Determine if the parameter can be captured. | |
| void | setDoesNotCapture (unsigned n, bool DoesNotCapture=true) |
| void | copyAttributesFrom (const GlobalValue *Src) |
| void | deleteBody () |
| virtual void | removeFromParent () |
| virtual void | eraseFromParent () |
| const ArgumentListType & | getArgumentList () const |
| ArgumentListType & | getArgumentList () |
| const BasicBlockListType & | getBasicBlockList () const |
| BasicBlockListType & | getBasicBlockList () |
| const BasicBlock & | getEntryBlock () const |
| BasicBlock & | getEntryBlock () |
| ValueSymbolTable & | getValueSymbolTable () |
| 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 () |
| arg_iterator | arg_begin () |
| const_arg_iterator | arg_begin () const |
| arg_iterator | arg_end () |
| const_arg_iterator | arg_end () const |
| size_t | arg_size () const |
| bool | arg_empty () const |
| void | viewCFG () const |
| void | viewCFGOnly () const |
| void | dropAllReferences () |
| bool | hasAddressTaken (const User **=0) const |
| bool | isDefTriviallyDead () const |
| bool | callsFunctionThatReturnsTwice () const |
Static Public Member Functions | |
| static Function * | Create (FunctionType *Ty, LinkageTypes Linkage, const Twine &N="", Module *M=0) |
| static iplist< Argument > Function::* | getSublistAccess (Argument *) |
| static iplist< BasicBlock > Function::* | getSublistAccess (BasicBlock *) |
| static bool | classof (const Function *) |
| Methods for support type inquiry through isa, cast, and dyn_cast: | |
| static bool | classof (const Value *V) |
Friends | |
| class | SymbolTableListTraits< Function, Module > |
Definition at line 70 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.
| Function::~Function | ( | ) |
Definition at line 187 of file Function.cpp.
References llvm::iplist< NodeTy, Traits >::clear(), clearGC(), and dropAllReferences().
| void Function::addAttribute | ( | unsigned | i, |
| Attributes | attr | ||
| ) |
addAttribute - adds the attribute to the list of attributes.
Definition at line 245 of file Function.cpp.
References llvm::AttrListPtr::addAttr(), getAttributes(), and setAttributes().
Referenced by llvm::Argument::addAttr(), addFnAttr(), setDoesNotAlias(), and setDoesNotCapture().
| void llvm::Function::addFnAttr | ( | Attributes | N | ) | [inline] |
addFnAttr - Add function attributes to this function.
Definition at line 179 of file Function.h.
References addAttribute().
Referenced by InlineCallIfPossible(), setDoesNotAccessMemory(), setDoesNotReturn(), setDoesNotThrow(), setHasUWTable(), and setOnlyReadsMemory().
| arg_iterator llvm::Function::arg_begin | ( | ) | [inline] |
Definition at line 367 of file Function.h.
References llvm::iplist< NodeTy, Traits >::begin().
Referenced by AddFastCallStdCallSuffix(), AllCallersPassInValidPointerForArgument(), llvm::Interpreter::callFunction(), llvm::CloneAndPruneFunctionInto(), llvm::CloneFunction(), llvm::CloneFunctionInto(), llvm::CloneModule(), llvm::PTXAsmPrinter::EmitFunctionEntryLabel(), EnsureFPIntrinsicsExist(), llvm::Argument::getArgNo(), GetFunctionClass(), llvm::SparcTargetLowering::getSRetArgSize(), HasNestArgument(), llvm::ValueEnumerator::incorporateFunction(), llvm::InlineFunction(), llvm::InsertProfilingInitCall(), isDynamicConstant(), LLVMGetFirstParam(), LLVMGetLastParam(), LLVMGetParams(), LLVMGetPreviousParam(), llvm::NVPTXTargetLowering::LowerFormalArguments(), UpgradeIntrinsicFunction1(), and WriteFunctionUseList().
| const_arg_iterator llvm::Function::arg_begin | ( | ) | const [inline] |
Definition at line 371 of file Function.h.
References llvm::iplist< NodeTy, Traits >::begin().
| bool Function::arg_empty | ( | ) | const |
Definition at line 215 of file Function.cpp.
References getFunctionType(), and llvm::FunctionType::getNumParams().
| arg_iterator llvm::Function::arg_end | ( | ) | [inline] |
Definition at line 375 of file Function.h.
References llvm::iplist< NodeTy, Traits >::end().
Referenced by AddFastCallStdCallSuffix(), llvm::Interpreter::callFunction(), llvm::CloneAndPruneFunctionInto(), llvm::CloneFunction(), llvm::CloneFunctionInto(), llvm::PTXAsmPrinter::EmitFunctionEntryLabel(), EnsureFPIntrinsicsExist(), GetFunctionClass(), HasNestArgument(), llvm::ValueEnumerator::incorporateFunction(), llvm::InlineFunction(), LLVMGetFirstParam(), LLVMGetLastParam(), LLVMGetNextParam(), LLVMGetParams(), llvm::NVPTXTargetLowering::LowerFormalArguments(), and WriteFunctionUseList().
| const_arg_iterator llvm::Function::arg_end | ( | ) | const [inline] |
Definition at line 379 of file Function.h.
References llvm::iplist< NodeTy, Traits >::end().
| size_t Function::arg_size | ( | ) | const |
Definition at line 212 of file Function.cpp.
References getFunctionType(), and llvm::FunctionType::getNumParams().
Referenced by llvm::Interpreter::callFunction(), llvm::CloneFunctionInto(), llvm::InlineFunction(), llvm::InsertProfilingInitCall(), and UpgradeIntrinsicFunction1().
| const BasicBlock& llvm::Function::back | ( | ) | const [inline] |
Definition at line 361 of file Function.h.
References llvm::iplist< NodeTy, Traits >::back().
Referenced by llvm::InlineFunction().
| BasicBlock& llvm::Function::back | ( | ) | [inline] |
Definition at line 362 of file Function.h.
References llvm::iplist< NodeTy, Traits >::back().
| iterator llvm::Function::begin | ( | ) | [inline] |
Definition at line 352 of file Function.h.
References llvm::iplist< NodeTy, Traits >::begin().
Referenced by llvm::CodeMetrics::analyzeFunction(), llvm::Interpreter::callFunction(), llvm::CloneAndPruneFunctionInto(), llvm::CloneFunctionInto(), ComputePostOrders(), cxxDtorIsEmpty(), llvm::InstCombiner::DoOneIteration(), dropAllReferences(), llvm::dumpBlock(), llvm::AsmPrinter::EmitFunctionBody(), findDbgDeclare(), getCommonReturnValue(), HandleByValArgument(), llvm::ValueEnumerator::incorporateFunction(), IncorporateFunctionInfoGlobalBBIDs(), llvm::InlineFunction(), llvm::InsertProfilingInitCall(), isInlineViable(), isOnlyUsedInEntryBlock(), IterativeSimplifyCFG(), LLVMGetBasicBlocks(), LLVMGetFirstBasicBlock(), LLVMGetLastBasicBlock(), LLVMGetPreviousBasicBlock(), llvm::LowerDbgDeclare(), MergeEmptyReturnBlocks(), llvm::GraphTraits< Function * >::nodes_begin(), llvm::GraphTraits< const Function * >::nodes_begin(), llvm::BranchProbabilityInfo::print(), llvm::SparseSolver::Print(), RemoveUnreachableBlocksFromFn(), llvm::NVPTXSplitBBatBar::runOnFunction(), llvm::NVPTXLowerAggrCopies::runOnFunction(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::Inliner::runOnSCC(), llvm::FunctionLoweringInfo::set(), SplitCriticalSideEffectEdges(), WriteFunction(), WriteFunctionUseList(), and WriteMetadataAttachment().
| const_iterator llvm::Function::begin | ( | ) | const [inline] |
Definition at line 353 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 469 of file Function.cpp.
References llvm::CallInst::canReturnTwice(), llvm::dyn_cast(), llvm::ARM_PROC::I, llvm::inst_begin(), and llvm::inst_end().
Referenced by llvm::CodeMetrics::analyzeFunction(), and llvm::SelectionDAGISel::runOnMachineFunction().
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition at line 403 of file Function.h.
Reimplemented from llvm::GlobalValue.
Definition at line 404 of file Function.h.
References llvm::Value::FunctionVal, and llvm::Value::getValueID().
| void Function::clearGC | ( | ) |
Definition at line 285 of file Function.cpp.
References llvm::StringPool::empty(), GCLock, GCNamePool, and GCNames.
Referenced by copyAttributesFrom(), LLVMSetGC(), and ~Function().
| void Function::copyAttributesFrom | ( | const GlobalValue * | Src | ) | [virtual] |
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 302 of file Function.cpp.
References clearGC(), getAttributes(), getCallingConv(), getGC(), hasGC(), setAttributes(), setCallingConv(), and setGC().
Referenced by llvm::CloneFunctionInto(), and llvm::CloneModule().
| static Function* llvm::Function::Create | ( | FunctionType * | Ty, |
| LinkageTypes | Linkage, | ||
| const Twine & | N = "", |
||
| Module * | M = 0 |
||
| ) | [inline, static] |
Definition at line 124 of file Function.h.
References N.
Referenced by llvm::CloneFunction(), llvm::CloneModule(), llvm::Module::getOrInsertFunction(), llvm::Module::getOrInsertTargetIntrinsic(), LLVMAddFunction(), and llvm::JIT::runFunction().
| void llvm::Function::deleteBody | ( | ) | [inline] |
deleteBody - This method deletes the body of the function, and converts the linkage to external.
Definition at line 300 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 215 of file Function.h.
References hasFnAttr().
Referenced by onlyReadsMemory().
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 275 of file Function.h.
References paramHasAttr().
Determine if the parameter can be captured.
| n | The parameter to check. 1 is the first parameter, 0 is the return |
Definition at line 285 of file Function.h.
References paramHasAttr().
| bool llvm::Function::doesNotReturn | ( | ) | const [inline] |
Determine if the function cannot return.
Definition at line 233 of file Function.h.
References hasFnAttr().
| bool llvm::Function::doesNotThrow | ( | ) | const [inline] |
Determine if the function cannot unwind.
Definition at line 242 of file Function.h.
References hasFnAttr().
Referenced by llvm::DwarfException::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 235 of file Function.cpp.
References begin(), llvm::iplist< NodeTy, Traits >::begin(), llvm::iplist< NodeTy, Traits >::empty(), end(), and llvm::ARM_PROC::I.
Referenced by deleteBody(), and ~Function().
| bool llvm::Function::empty | ( | ) | const [inline] |
Definition at line 358 of file Function.h.
References llvm::iplist< NodeTy, Traits >::empty().
| iterator llvm::Function::end | ( | ) | [inline] |
Definition at line 354 of file Function.h.
References llvm::iplist< NodeTy, Traits >::end().
Referenced by llvm::CodeMetrics::analyzeFunction(), llvm::CloneAndPruneFunctionInto(), llvm::CloneFunctionInto(), ComputePostOrders(), cxxDtorIsEmpty(), llvm::InstCombiner::DoOneIteration(), dropAllReferences(), llvm::dumpBlock(), llvm::AsmPrinter::EmitFunctionBody(), findDbgDeclare(), fixupLineNumbers(), getCommonReturnValue(), HandleInlinedInvoke(), llvm::ValueEnumerator::incorporateFunction(), IncorporateFunctionInfoGlobalBBIDs(), llvm::InlineFunction(), isInlineViable(), IterativeSimplifyCFG(), LLVMGetBasicBlocks(), LLVMGetFirstBasicBlock(), LLVMGetLastBasicBlock(), LLVMGetNextBasicBlock(), llvm::LowerDbgDeclare(), MergeEmptyReturnBlocks(), llvm::GraphTraits< Function * >::nodes_end(), llvm::GraphTraits< const Function * >::nodes_end(), llvm::BranchProbabilityInfo::print(), llvm::SparseSolver::Print(), RemoveUnreachableBlocksFromFn(), llvm::NVPTXSplitBBatBar::runOnFunction(), llvm::NVPTXLowerAggrCopies::runOnFunction(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::Inliner::runOnSCC(), llvm::FunctionLoweringInfo::set(), SplitCriticalSideEffectEdges(), llvm::UnrollRuntimeLoopProlog(), WriteFunction(), WriteFunctionUseList(), and WriteMetadataAttachment().
| const_iterator llvm::Function::end | ( | ) | const [inline] |
Definition at line 355 of file Function.h.
References llvm::iplist< NodeTy, Traits >::end().
| void Function::eraseFromParent | ( | ) | [virtual] |
eraseFromParent - This method unlinks 'this' from the containing module and deletes it.
Implements llvm::GlobalValue.
Definition at line 155 of file Function.cpp.
References llvm::Module::getFunctionList(), and llvm::GlobalValue::getParent().
Referenced by INITIALIZE_PASS(), llvm::JIT::runFunction(), and llvm::UpgradeCallsToIntrinsic().
| const BasicBlock& llvm::Function::front | ( | ) | const [inline] |
Definition at line 359 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 360 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 319 of file Function.h.
Referenced by llvm::Argument::Argument().
| ArgumentListType& llvm::Function::getArgumentList | ( | ) | [inline] |
Definition at line 323 of file Function.h.
| const AttrListPtr& llvm::Function::getAttributes | ( | ) | const [inline] |
getAttributes - Return the attribute list for this Function.
Definition at line 165 of file Function.h.
Referenced by addAttribute(), llvm::CloneFunctionInto(), copyAttributesFrom(), llvm::ValueEnumerator::incorporateFunction(), llvm::isInTailCallPosition(), LLVMAddFunctionAttr(), LLVMGetAttribute(), LLVMGetFunctionAttr(), LLVMRemoveFunctionAttr(), llvm::NVPTXTargetLowering::LowerFormalArguments(), llvm::MachineFunction::MachineFunction(), removeAttribute(), RemoveNestAttribute(), llvm::FunctionLoweringInfo::set(), and llvm::InstCombiner::visitFPTrunc().
| const BasicBlockListType& llvm::Function::getBasicBlockList | ( | ) | const [inline] |
Definition at line 331 of file Function.h.
Referenced by llvm::CloneAndPruneFunctionInto(), llvm::BasicBlock::eraseFromParent(), llvm::InlineFunction(), llvm::BasicBlock::moveAfter(), llvm::BasicBlock::moveBefore(), llvm::BasicBlock::removeFromParent(), RemoveUnreachableBlocksFromFn(), llvm::SplitCriticalEdge(), llvm::UnrollLoop(), and llvm::UnrollRuntimeLoopProlog().
| BasicBlockListType& llvm::Function::getBasicBlockList | ( | ) | [inline] |
Definition at line 332 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 155 of file Function.h.
References llvm::Value::getSubclassDataFromValue().
Referenced by copyAttributesFrom(), llvm::PPCFrameLowering::emitEpilogue(), llvm::MBlazeFrameLowering::emitEpilogue(), llvm::MBlazeFrameLowering::emitPrologue(), llvm::MSP430RegisterInfo::getCalleeSavedRegs(), llvm::X86RegisterInfo::getCalleeSavedRegs(), GetScratchRegister(), interruptFrameLayout(), llvm::HexagonTargetLowering::IsEligibleForTailCallOptimization(), llvm::isKernelFunction(), llvm::MBlazeFrameLowering::processFunctionBeforeCalleeSavedScan(), profileFunction(), llvm::JIT::runFunction(), 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 135 of file Function.cpp.
References llvm::Type::getContext(), and llvm::GlobalValue::getType().
Referenced by llvm::DwarfDebug::beginFunction(), llvm::ConstantFoldCall(), duplicateCPV(), llvm::NVPTXAsmPrinter::emitLineNumberAsDotLoc(), llvm::Thumb2RegisterInfo::emitLoadConstPool(), llvm::Thumb1RegisterInfo::emitLoadConstPool(), llvm::ARMBaseRegisterInfo::emitLoadConstPool(), llvm::FastISel::FastEmit_ri_(), llvm::LexicalScopes::findLexicalScope(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::BlockAddress::get(), llvm::ScalarEvolution::getContext(), llvm::SelectionDAG::init(), llvm::InsertProfilingInitCall(), llvm::isFreeCall(), llvm::NVPTXTargetLowering::LowerFormalArguments(), printDebugLoc(), llvm::JIT::runFunction(), llvm::ExecutionEngine::runFunctionAsMain(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::InstCombiner::runOnFunction(), llvm::FunctionLoweringInfo::set(), and UpgradeIntrinsicFunction1().
| const BasicBlock& llvm::Function::getEntryBlock | ( | ) | const [inline] |
Definition at line 337 of file Function.h.
References front().
Referenced by CheckForEscapingAllocas(), llvm::CloneAndPruneFunctionInto(), llvm::CloneBasicBlock(), ComputePostOrders(), 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(), llvm::ProfileInfoT< FType, BType >::getExecutionCount(), llvm::MemoryDependenceAnalysis::getNonLocalCallDependency(), llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), llvm::BallLarusDag::init(), llvm::InlineFunction(), llvm::SelectionDAGBuilder::isExportableFromCurrentBlock(), NegateValue(), llvm::ProfileInfoT< FType, BType >::repair(), llvm::BranchProbabilityInfo::runOnFunction(), llvm::RegionInfo::runOnFunction(), llvm::SparseSolver::Solve(), llvm::TryToSimplifyUncondBranchFromEmptyBlock(), TryToSinkInstruction(), and ValueDominatesPHI().
| BasicBlock& llvm::Function::getEntryBlock | ( | ) | [inline] |
Definition at line 338 of file Function.h.
References front().
| FunctionType * Function::getFunctionType | ( | ) | const |
Definition at line 139 of file Function.cpp.
References llvm::SequentialType::getElementType(), and llvm::GlobalValue::getType().
Referenced by arg_empty(), arg_size(), llvm::Interpreter::callExternalFunction(), llvm::Interpreter::callFunction(), llvm::CloneFunction(), FindCXAAtExit(), llvm::SimplifyFortifiedLibCalls::fold(), getReturnType(), llvm::InlineFunction(), isCallocCall(), llvm::isFreeCall(), isMallocCall(), isVarArg(), lookupFunction(), llvm::HexagonTargetLowering::LowerCall(), profileFunction(), llvm::MCJIT::runFunction(), llvm::Interpreter::runFunction(), llvm::JIT::runFunction(), and llvm::ExecutionEngine::runFunctionAsMain().
| const char * Function::getGC | ( | ) | const |
Definition at line 270 of file Function.cpp.
References GCLock, and hasGC().
Referenced by copyAttributesFrom(), llvm::GCModuleInfo::getFunctionInfo(), llvm::InlineFunction(), and LLVMGetGC().
| 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 instrinsic, 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.
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 321 of file Function.cpp.
References llvm::StringMapEntry< ValueTy >::getKeyData(), llvm::StringMapEntryBase::getKeyLength(), and llvm::Value::getValueName().
Referenced by llvm::canConstantFoldCallTo(), llvm::ConstantFoldCall(), llvm::IntrinsicInst::getIntrinsicID(), isIntrinsic(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::UpgradeIntrinsicCall(), llvm::UpgradeIntrinsicFunction(), and llvm::Interpreter::visitCallSite().
Extract the alignment for a call or parameter (0=unknown).
Definition at line 210 of file Function.h.
References llvm::AttrListPtr::getParamAlignment().
Referenced by llvm::Argument::getParamAlignment(), and llvm::InlineFunction().
| Type * Function::getReturnType | ( | ) | const |
Definition at line 147 of file Function.cpp.
References getFunctionType(), and llvm::FunctionType::getReturnType().
Referenced by llvm::Interpreter::callFunction(), llvm::ConstantFoldCall(), llvm::IRBuilderBase::getCurrentFunctionReturnType(), llvm::InlineFunction(), NumRetVals(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::FunctionLoweringInfo::set(), and UpgradeIntrinsicFunction1().
| static iplist<Argument> Function::* llvm::Function::getSublistAccess | ( | Argument * | ) | [inline, static] |
Definition at line 327 of file Function.h.
| static iplist<BasicBlock> Function::* llvm::Function::getSublistAccess | ( | BasicBlock * | ) | [inline, static] |
Definition at line 333 of file Function.h.
| ValueSymbolTable& llvm::Function::getValueSymbolTable | ( | ) | [inline] |
getSymbolTable() - Return the symbol table...
Definition at line 345 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 346 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. 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 439 of file Function.cpp.
References llvm::ARM_PROC::I, llvm::Value::use_begin(), and llvm::Value::use_end().
| bool llvm::Function::hasFnAttr | ( | Attributes | N | ) | const [inline] |
hasFnAttr - Return true if this function has the given attribute.
Definition at line 172 of file Function.h.
References llvm::AttrListPtr::paramHasAttr().
Referenced by llvm::CodeMetrics::analyzeFunction(), checkNumAlignedDPRCS2Regs(), llvm::PPCFrameLowering::determineFrameLayout(), doesNotAccessMemory(), doesNotReturn(), doesNotThrow(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::X86FrameLowering::emitPrologue(), ExpandPowI(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::InlineCostAnalyzer::getInlineCost(), llvm::Inliner::getInlineThreshold(), llvm::MemoryDependenceAnalysis::getLoadLoadClobberFullWidthSize(), getMemcpyLoadsAndStores(), getMemmoveLoadsAndStores(), getMemsetStores(), llvm::ARMBaseInstrInfo::getOperandLatency(), llvm::ARMTargetLowering::getOptimalMemOpType(), llvm::X86TargetLowering::getOptimalMemOpType(), hasUWTable(), InlineCallIfPossible(), isInlineViable(), llvm::MachineFunction::MachineFunction(), llvm::PPCFrameLowering::needsFP(), llvm::X86RegisterInfo::needsStackRealignment(), llvm::ARMBaseRegisterInfo::needsStackRealignment(), onlyReadsMemory(), PerformSTORECombine(), ProfitableToMerge(), llvm::Inliner::removeDeadFunctions(), and llvm::PEI::runOnMachineFunction().
| bool Function::hasGC | ( | ) | const |
hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm to use during code generation.
Definition at line 265 of file Function.cpp.
References GCLock, and GCNames.
Referenced by copyAttributesFrom(), llvm::GCModuleInfo::getFunctionInfo(), getGC(), llvm::InlineFunction(), LLVMGetGC(), profileFunction(), and llvm::SelectionDAGISel::runOnMachineFunction().
| bool llvm::Function::hasStructRetAttr | ( | ) | const [inline] |
Determine if the function returns a structure through first pointer argument.
Definition at line 269 of file Function.h.
References paramHasAttr().
Referenced by llvm::SparcTargetLowering::getSRetArgSize(), llvm::HexagonTargetLowering::LowerCall(), llvm::SparcTargetLowering::LowerFormalArguments(), and llvm::SparcTargetLowering::LowerReturn().
| 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 252 of file Function.h.
References hasFnAttr().
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 453 of file Function.cpp.
References llvm::GlobalValue::hasAvailableExternallyLinkage(), llvm::GlobalValue::hasLinkOnceLinkage(), llvm::GlobalValue::hasLocalLinkage(), llvm::ARM_PROC::I, llvm::Value::use_begin(), and llvm::Value::use_end().
Referenced by llvm::Inliner::removeDeadFunctions().
| bool llvm::Function::isIntrinsic | ( | ) | const [inline] |
Definition at line 150 of file Function.h.
References getIntrinsicID().
Referenced by llvm::CallGraphNode::addCalledFunction(), and llvm::Module::getOrInsertFunction().
| bool Function::isVarArg | ( | ) | const |
isVarArg - Return true if this function takes a variable number of arguments.
Definition at line 143 of file Function.cpp.
References getFunctionType(), and llvm::FunctionType::isVarArg().
Referenced by llvm::X86FrameLowering::adjustForSegmentedStacks(), llvm::HexagonTargetLowering::LowerCall(), llvm::XCoreFrameLowering::processFunctionBeforeCalleeSavedScan(), and llvm::FunctionLoweringInfo::set().
| bool llvm::Function::needsUnwindTableEntry | ( | ) | const [inline] |
True if this function needs an unwind table.
Definition at line 263 of file Function.h.
References doesNotThrow(), and hasUWTable().
Referenced by llvm::ARMException::BeginFunction(), llvm::HexagonFrameLowering::emitPrologue(), llvm::PPCFrameLowering::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 224 of file Function.h.
References doesNotAccessMemory(), and hasFnAttr().
Referenced by HandleByValArgument().
| bool llvm::Function::paramHasAttr | ( | unsigned | i, |
| Attributes | attr | ||
| ) | const [inline] |
Determine whether the function has the given attribute.
Definition at line 199 of file Function.h.
References llvm::AttrListPtr::paramHasAttr().
Referenced by doesNotAlias(), doesNotCapture(), llvm::Argument::hasByValAttr(), llvm::Argument::hasNestAttr(), llvm::Argument::hasNoAliasAttr(), llvm::Argument::hasNoCaptureAttr(), llvm::Argument::hasStructRetAttr(), and hasStructRetAttr().
| void Function::removeAttribute | ( | unsigned | i, |
| Attributes | attr | ||
| ) |
removeAttribute - removes the attribute from the list of attributes.
Definition at line 251 of file Function.cpp.
References getAttributes(), llvm::AttrListPtr::removeAttr(), and setAttributes().
Referenced by llvm::Argument::removeAttr(), removeFnAttr(), setDoesNotAlias(), and setDoesNotCapture().
| void llvm::Function::removeFnAttr | ( | Attributes | N | ) | [inline] |
removeFnAttr - Remove function attributes from this function.
Definition at line 186 of file Function.h.
References removeAttribute().
Referenced by setDoesNotAccessMemory(), setDoesNotReturn(), setDoesNotThrow(), setHasUWTable(), and setOnlyReadsMemory().
| void Function::removeFromParent | ( | ) | [virtual] |
removeFromParent - This method unlinks 'this' from the containing module, but does not delete it.
Implements llvm::GlobalValue.
Definition at line 151 of file Function.cpp.
References llvm::Module::getFunctionList(), and llvm::GlobalValue::getParent().
| void llvm::Function::setAttributes | ( | const AttrListPtr & | attrs | ) | [inline] |
setAttributes - Set the attribute list for this Function.
Definition at line 169 of file Function.h.
Referenced by addAttribute(), llvm::CloneFunctionInto(), copyAttributesFrom(), llvm::Module::getOrInsertFunction(), llvm::Module::getOrInsertTargetIntrinsic(), LLVMAddFunctionAttr(), LLVMRemoveFunctionAttr(), removeAttribute(), RemoveNestAttribute(), and llvm::UpgradeIntrinsicFunction().
| void llvm::Function::setCallingConv | ( | CallingConv::ID | CC | ) | [inline] |
Definition at line 158 of file Function.h.
References llvm::Value::getSubclassDataFromValue().
Referenced by copyAttributesFrom().
Definition at line 218 of file Function.h.
References addFnAttr(), and removeFnAttr().
Definition at line 278 of file Function.h.
References addAttribute(), and removeAttribute().
Definition at line 288 of file Function.h.
References addAttribute(), and removeAttribute().
Definition at line 236 of file Function.h.
References addFnAttr(), and removeFnAttr().
Definition at line 245 of file Function.h.
References addFnAttr(), and removeFnAttr().
| void Function::setGC | ( | const char * | Str | ) |
Definition at line 276 of file Function.cpp.
References GCLock, GCNamePool, GCNames, and llvm::StringPool::intern().
Referenced by copyAttributesFrom(), llvm::InlineFunction(), and LLVMSetGC().
Definition at line 255 of file Function.h.
References addFnAttr(), and removeFnAttr().
Definition at line 227 of file Function.h.
References addFnAttr(), and removeFnAttr().
| size_t llvm::Function::size | ( | ) | const [inline] |
Definition at line 357 of file Function.h.
References llvm::iplist< NodeTy, Traits >::size().
Referenced by profileFunction(), RemoveUnreachableBlocksFromFn(), 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.
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 t his 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.