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 () | |
| const Type * | getReturnType () const |
| const FunctionType * | getFunctionType () const |
| LLVMContext & | getContext () const |
| bool | isVarArg () const |
| virtual bool | isDeclaration () const |
| unsigned | getIntrinsicID () const |
| bool | isIntrinsic () const |
| unsigned | getCallingConv () const |
| void | setCallingConv (unsigned 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 | 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 |
Static Public Member Functions | |
| static Function * | Create (const 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 68 of file Function.h.
Definition at line 71 of file Function.h.
Definition at line 72 of file Function.h.
| typedef BasicBlockListType::iterator llvm::Function::iterator |
Definition at line 75 of file Function.h.
| typedef BasicBlockListType::const_iterator llvm::Function::const_iterator |
Definition at line 76 of file Function.h.
| typedef ArgumentListType::iterator llvm::Function::arg_iterator |
Definition at line 78 of file Function.h.
| typedef ArgumentListType::const_iterator llvm::Function::const_arg_iterator |
Definition at line 79 of file Function.h.
| Function::~Function | ( | ) |
| static Function* llvm::Function::Create | ( | const FunctionType * | Ty, | |
| LinkageTypes | Linkage, | |||
| const Twine & | N = "", |
|||
| Module * | M = 0 | |||
| ) | [inline, static] |
Definition at line 119 of file Function.h.
References M.
Referenced by llvm::CloneFunction(), llvm::CloneModule(), fold(), llvm::Module::getOrInsertFunction(), llvm::Module::getOrInsertTargetIntrinsic(), llvm::JIT::runFunction(), and ThunkGToF().
| const Type * Function::getReturnType | ( | ) | const |
Definition at line 130 of file Function.cpp.
References getFunctionType(), and llvm::FunctionType::getReturnType().
Referenced by llvm::Interpreter::callFunction(), llvm::ConstantFoldCall(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateAggregateRet(), getCommonReturnValue(), llvm::PIC16TargetLowering::InitReservedFrameCount(), NumRetVals(), llvm::MSILWriter::printFunction(), llvm::MSILWriter::printModuleStartup(), llvm::RemoveSuccessor(), llvm::UnifyFunctionExitNodes::runOnFunction(), ThunkGToF(), and llvm::UpgradeIntrinsicCall().
| const FunctionType * Function::getFunctionType | ( | ) | const |
Definition at line 122 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(), llvm::X86IntelAsmPrinter::decorateName(), llvm::PointerTracking::doInitialization(), equals(), EvaluateFunction(), ffiInvoke(), fold(), getReturnType(), hash(), isVarArg(), LinkFunctionProtos(), lookupFunction(), llvm::MSILWriter::printExternals(), llvm::JIT::runFunction(), llvm::Interpreter::runFunction(), llvm::ExecutionEngine::runFunctionAsMain(), ThunkGToF(), llvm::UpgradeIntrinsicCall(), and UpgradeIntrinsicFunction1().
| 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 118 of file Function.cpp.
References llvm::Type::getContext(), and llvm::GlobalValue::getType().
Referenced by llvm::CloneAndPruneFunctionInto(), llvm::ConstantFoldCall(), llvm::Thumb2RegisterInfo::emitLoadConstPool(), llvm::Thumb1RegisterInfo::emitLoadConstPool(), llvm::ARMBaseRegisterInfo::emitLoadConstPool(), EvaluateFunction(), EvaluateStaticConstructor(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::ScalarEvolution::getContext(), llvm::SelectionDAGLowering::GetRegistersForValue(), llvm::ValueEnumerator::incorporateFunction(), llvm::SelectionDAG::init(), llvm::InsertProfilingInitCall(), LinkFunctionBody(), llvm::MachineFunction::MachineFunction(), NumRetVals(), llvm::MSILWriter::printLocalVariables(), RemoveUnreachableBlocksFromFn(), llvm::JIT::runFunction(), llvm::ExecutionEngine::runFunctionAsMain(), llvm::UnifyFunctionExitNodes::runOnFunction(), ThunkGToF(), and WriteFunction().
| bool Function::isVarArg | ( | ) | const |
isVarArg - Return true if this function takes a variable number of arguments.
Definition at line 126 of file Function.cpp.
References getFunctionType(), and llvm::FunctionType::isVarArg().
Referenced by equals(), ffiInvoke(), llvm::MSILWriter::printFunction(), and llvm::XCoreRegisterInfo::processFunctionBeforeCalleeSavedScan().
| virtual bool llvm::Function::isDeclaration | ( | ) | const [inline, virtual] |
isDeclaration - Is the body of this function unknown? (The basic block list is empty if so.) This is true for function declarations, but not true for function definitions.
Implements llvm::GlobalValue.
Definition at line 141 of file Function.h.
Referenced by llvm::Interpreter::callFunction(), llvm::BitcodeReader::dematerializeFunction(), EvaluateFunction(), GetAllUndefinedSymbols(), llvm::ProfileInfo::getExecutionCount(), llvm::GCModuleInfo::getFunctionInfo(), llvm::InlineCostAnalyzer::getInlineCost(), llvm::JIT::getPointerToFunction(), llvm::BasicInlinerImpl::inlineFunctions(), LinkFunctionBodies(), LinkFunctionBody(), LinkFunctionProtos(), llvm::MSILWriter::printModuleStartup(), llvm::FunctionPass::run(), llvm::FPPassManager::runOnFunction(), llvm::MSILWriter::runOnFunction(), llvm::Inliner::runOnSCC(), llvm::verifyFunction(), and llvm::Interpreter::visitCallSite().
| 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 299 of file Function.cpp.
References llvm::StringMapEntry< ValueTy >::getKeyData(), llvm::StringMapEntryBase::getKeyLength(), and llvm::Value::getValueName().
Referenced by llvm::canConstantFoldCallTo(), llvm::IntrinsicInst::getIntrinsicID(), llvm::AliasAnalysis::getModRefBehavior(), isIntrinsic(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::UpgradeIntrinsicCall(), llvm::UpgradeIntrinsicFunction(), and llvm::Interpreter::visitCallSite().
| bool llvm::Function::isIntrinsic | ( | ) | const [inline] |
Definition at line 151 of file Function.h.
References getIntrinsicID().
Referenced by llvm::Module::getOrInsertFunction().
| unsigned llvm::Function::getCallingConv | ( | ) | const [inline] |
getCallingConv()/setCallingConv(uint) - 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 156 of file Function.h.
References llvm::Value::SubclassData.
Referenced by calculateFunctionInfo(), copyAttributesFrom(), llvm::X86IntelAsmPrinter::decorateName(), llvm::PPCRegisterInfo::emitEpilogue(), equals(), llvm::InlineCostAnalyzer::getInlineCost(), llvm::MSILWriter::getLibraryName(), hash(), llvm::X86TargetLowering::IsEligibleForTailCallOptimization(), llvm::PPCTargetLowering::IsEligibleForTailCallOptimization(), llvm::MSILWriter::printExternals(), llvm::MSILWriter::printFunction(), llvm::MSILWriter::printModuleStartup(), llvm::JIT::runFunction(), llvm::X86IntelAsmPrinter::runOnMachineFunction(), llvm::X86ATTAsmPrinter::runOnMachineFunction(), and ThunkGToF().
| void llvm::Function::setCallingConv | ( | unsigned | CC | ) | [inline] |
Definition at line 157 of file Function.h.
References llvm::Value::SubclassData.
Referenced by copyAttributesFrom().
| const AttrListPtr& llvm::Function::getAttributes | ( | ) | const [inline] |
getAttributes - Return the attribute list for this Function.
Definition at line 163 of file Function.h.
Referenced by addAttribute(), llvm::CloneFunctionInto(), copyAttributesFrom(), equals(), llvm::ValueEnumerator::incorporateFunction(), LLVMAddFunctionAttr(), LLVMRemoveFunctionAttr(), removeAttribute(), RemoveNestAttribute(), and llvm::UpgradeIntrinsicCall().
| void llvm::Function::setAttributes | ( | const AttrListPtr & | attrs | ) | [inline] |
setAttributes - Set the attribute list for this Function.
Definition at line 167 of file Function.h.
Referenced by addAttribute(), llvm::CloneFunctionInto(), copyAttributesFrom(), llvm::Module::getOrInsertFunction(), llvm::Module::getOrInsertTargetIntrinsic(), LLVMAddFunctionAttr(), LLVMRemoveFunctionAttr(), removeAttribute(), RemoveNestAttribute(), and llvm::UpgradeIntrinsicFunction().
| bool llvm::Function::hasFnAttr | ( | Attributes | N | ) | const [inline] |
hasFnAttr - Return true if this function has the given attribute.
Definition at line 170 of file Function.h.
References llvm::AttrListPtr::paramHasAttr().
Referenced by llvm::PPCRegisterInfo::determineFrameLayout(), doesNotAccessMemory(), doesNotReturn(), doesNotThrow(), llvm::X86RegisterInfo::emitPrologue(), llvm::X86TargetLowering::getFunctionAlignment(), llvm::PPCTargetLowering::getFunctionAlignment(), llvm::MSP430TargetLowering::getFunctionAlignment(), llvm::InlineCostAnalyzer::getInlineCost(), llvm::X86TargetLowering::getOptimalMemOpType(), llvm::Inliner::InlineCallIfPossible(), onlyReadsMemory(), PerformSTORECombine(), and llvm::PEI::runOnMachineFunction().
| void llvm::Function::addFnAttr | ( | Attributes | N | ) | [inline] |
addFnAttr - Add function attributes to this function.
Definition at line 177 of file Function.h.
References addAttribute().
Referenced by llvm::Inliner::InlineCallIfPossible(), setDoesNotAccessMemory(), setDoesNotReturn(), setDoesNotThrow(), and setOnlyReadsMemory().
| void llvm::Function::removeFnAttr | ( | Attributes | N | ) | [inline] |
removeFnAttr - Remove function attributes from this function.
Definition at line 184 of file Function.h.
References removeAttribute().
Referenced by setDoesNotAccessMemory(), setDoesNotReturn(), setDoesNotThrow(), and setOnlyReadsMemory().
| bool Function::hasGC | ( | ) | const |
hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm to use during code generation.
Definition at line 243 of file Function.cpp.
References llvm::DenseMap< KeyT, ValueT, KeyInfoT, ValueInfoT >::count().
Referenced by copyAttributesFrom(), equals(), llvm::GCModuleInfo::getFunctionInfo(), getGC(), hash(), llvm::InlineFunction(), LLVMGetGC(), and llvm::SelectionDAGISel::runOnMachineFunction().
| const char * Function::getGC | ( | ) | const |
Definition at line 248 of file Function.cpp.
References hasGC().
Referenced by copyAttributesFrom(), equals(), llvm::GCModuleInfo::getFunctionInfo(), llvm::InlineFunction(), and LLVMGetGC().
| void Function::setGC | ( | const char * | Str | ) |
Definition at line 254 of file Function.cpp.
References llvm::StringPool::intern().
Referenced by copyAttributesFrom(), llvm::InlineFunction(), and LLVMSetGC().
| void Function::clearGC | ( | ) |
Definition at line 263 of file Function.cpp.
References llvm::DenseMap< KeyT, ValueT, KeyInfoT, ValueInfoT >::empty(), llvm::StringPool::empty(), and llvm::DenseMap< KeyT, ValueT, KeyInfoT, ValueInfoT >::erase().
Referenced by copyAttributesFrom(), LLVMSetGC(), and ~Function().
| bool llvm::Function::paramHasAttr | ( | unsigned | i, | |
| Attributes | attr | |||
| ) | const [inline] |
Determine whether the function has the given attribute.
Definition at line 197 of file Function.h.
References llvm::AttrListPtr::paramHasAttr().
Referenced by calculateFunctionInfo(), doesNotAlias(), doesNotCapture(), llvm::Argument::hasByValAttr(), llvm::Argument::hasNoAliasAttr(), llvm::Argument::hasNoCaptureAttr(), hasStructRetAttr(), llvm::Argument::hasStructRetAttr(), and llvm::MSILWriter::printFunction().
| void Function::addAttribute | ( | unsigned | i, | |
| Attributes | attr | |||
| ) |
addAttribute - adds the attribute to the list of attributes.
Definition at line 223 of file Function.cpp.
References llvm::AttrListPtr::addAttr(), getAttributes(), and setAttributes().
Referenced by llvm::Argument::addAttr(), addFnAttr(), setDoesNotAlias(), and setDoesNotCapture().
| void Function::removeAttribute | ( | unsigned | i, | |
| Attributes | attr | |||
| ) |
removeAttribute - removes the attribute from the list of attributes.
Definition at line 229 of file Function.cpp.
References getAttributes(), llvm::AttrListPtr::removeAttr(), and setAttributes().
Referenced by llvm::Argument::removeAttr(), removeFnAttr(), setDoesNotAlias(), and setDoesNotCapture().
Extract the alignment for a call or parameter (0=unknown).
Definition at line 208 of file Function.h.
References llvm::AttrListPtr::getParamAlignment().
| bool llvm::Function::doesNotAccessMemory | ( | ) | const [inline] |
Determine if the function does not access memory.
Definition at line 213 of file Function.h.
References hasFnAttr(), and llvm::Attribute::ReadNone.
Referenced by llvm::AliasAnalysis::getModRefBehavior(), and onlyReadsMemory().
| void llvm::Function::setDoesNotAccessMemory | ( | bool | DoesNotAccessMemory = true |
) | [inline] |
Definition at line 216 of file Function.h.
References addFnAttr(), llvm::Attribute::ReadNone, and removeFnAttr().
| bool llvm::Function::onlyReadsMemory | ( | ) | const [inline] |
Determine if the function does not access or only reads memory.
Definition at line 222 of file Function.h.
References doesNotAccessMemory(), hasFnAttr(), and llvm::Attribute::ReadOnly.
Referenced by llvm::AliasAnalysis::getModRefBehavior().
| void llvm::Function::setOnlyReadsMemory | ( | bool | OnlyReadsMemory = true |
) | [inline] |
Definition at line 225 of file Function.h.
References addFnAttr(), llvm::Attribute::ReadNone, llvm::Attribute::ReadOnly, and removeFnAttr().
| bool llvm::Function::doesNotReturn | ( | ) | const [inline] |
Determine if the function cannot return.
Definition at line 231 of file Function.h.
References hasFnAttr(), and llvm::Attribute::NoReturn.
| void llvm::Function::setDoesNotReturn | ( | bool | DoesNotReturn = true |
) | [inline] |
Definition at line 234 of file Function.h.
References addFnAttr(), llvm::Attribute::NoReturn, and removeFnAttr().
| bool llvm::Function::doesNotThrow | ( | ) | const [inline] |
Determine if the function cannot unwind.
Definition at line 240 of file Function.h.
References hasFnAttr(), and llvm::Attribute::NoUnwind.
Referenced by llvm::DwarfException::BeginFunction(), llvm::X86RegisterInfo::emitPrologue(), llvm::PPCRegisterInfo::emitPrologue(), and llvm::XCoreRegisterInfo::needsFrameMoves().
| void llvm::Function::setDoesNotThrow | ( | bool | DoesNotThrow = true |
) | [inline] |
Definition at line 243 of file Function.h.
References addFnAttr(), llvm::Attribute::NoUnwind, and removeFnAttr().
| bool llvm::Function::hasStructRetAttr | ( | ) | const [inline] |
Determine if the function returns a structure through first pointer argument.
Definition at line 250 of file Function.h.
References paramHasAttr(), and llvm::Attribute::StructRet.
Referenced by llvm::X86IntelAsmPrinter::decorateName().
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 256 of file Function.h.
References llvm::Attribute::NoAlias, and paramHasAttr().
Definition at line 259 of file Function.h.
References addAttribute(), llvm::Attribute::NoAlias, and removeAttribute().
Determine if the parameter can be captured.
| n | The parameter to check. 1 is the first parameter, 0 is the return |
Definition at line 266 of file Function.h.
References llvm::Attribute::NoCapture, and paramHasAttr().
Definition at line 269 of file Function.h.
References addAttribute(), llvm::Attribute::NoCapture, and removeAttribute().
| 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.
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 280 of file Function.cpp.
References clearGC(), llvm::GlobalValue::copyAttributesFrom(), getAttributes(), getCallingConv(), getGC(), hasGC(), setAttributes(), setCallingConv(), and setGC().
Referenced by llvm::CloneFunctionInto(), llvm::CloneModule(), fold(), and ThunkGToF().
| void llvm::Function::deleteBody | ( | ) | [inline] |
deleteBody - This method deletes the body of the function, and converts the linkage to external.
Definition at line 281 of file Function.h.
References dropAllReferences(), llvm::GlobalValue::ExternalLinkage, and llvm::GlobalValue::setLinkage().
Referenced by llvm::BitcodeReader::dematerializeFunction().
| void Function::removeFromParent | ( | ) | [virtual] |
removeFromParent - This method unlinks 'this' from the containing module, but does not delete it.
Implements llvm::GlobalValue.
Definition at line 134 of file Function.cpp.
References llvm::Module::getFunctionList(), and llvm::GlobalValue::getParent().
| void Function::eraseFromParent | ( | ) | [virtual] |
eraseFromParent - This method unlinks 'this' from the containing module and deletes it.
Implements llvm::GlobalValue.
Definition at line 138 of file Function.cpp.
References llvm::Module::getFunctionList(), and llvm::GlobalValue::getParent().
Referenced by AliasGToF(), StripDebugInfo(), ThunkGToF(), and llvm::UpgradeCallsToIntrinsic().
| 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 300 of file Function.h.
Referenced by llvm::Argument::Argument().
| ArgumentListType& llvm::Function::getArgumentList | ( | ) | [inline] |
Definition at line 304 of file Function.h.
| static iplist<Argument> Function::* llvm::Function::getSublistAccess | ( | Argument * | ) | [inline, static] |
Definition at line 308 of file Function.h.
| const BasicBlockListType& llvm::Function::getBasicBlockList | ( | ) | const [inline] |
Definition at line 312 of file Function.h.
Referenced by llvm::CloneAndPruneFunctionInto(), llvm::CloneLoop(), llvm::BasicBlock::eraseFromParent(), llvm::InlineFunction(), LinkFunctionBody(), llvm::BasicBlock::moveAfter(), llvm::BasicBlock::moveBefore(), llvm::BasicBlock::removeFromParent(), RemoveUnreachableBlocksFromFn(), llvm::SimplifyCFG(), and llvm::SplitCriticalEdge().
| BasicBlockListType& llvm::Function::getBasicBlockList | ( | ) | [inline] |
Definition at line 313 of file Function.h.
| static iplist<BasicBlock> Function::* llvm::Function::getSublistAccess | ( | BasicBlock * | ) | [inline, static] |
Definition at line 314 of file Function.h.
| const BasicBlock& llvm::Function::getEntryBlock | ( | ) | const [inline] |
Definition at line 318 of file Function.h.
References front().
Referenced by CheckForEscapingAllocas(), llvm::CloneAndPruneFunctionInto(), llvm::CloneBasicBlock(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), equals(), llvm::FindFunctionBackedges(), getBackEdges(), llvm::MemoryDependenceAnalysis::getDependency(), llvm::GraphTraits< Inverse< const Function * > >::getEntryNode(), llvm::GraphTraits< Inverse< Function * > >::getEntryNode(), llvm::GraphTraits< const Function * >::getEntryNode(), llvm::GraphTraits< Function * >::getEntryNode(), llvm::ProfileInfo::getExecutionCount(), llvm::MemoryDependenceAnalysis::getNonLocalCallDependency(), llvm::InlineFunction(), llvm::SelectionDAGLowering::isExportableFromCurrentBlock(), llvm::SimplifyCFG(), llvm::SparseSolver::Solve(), SplitEdgeNicely(), and TryToSinkInstruction().
| BasicBlock& llvm::Function::getEntryBlock | ( | ) | [inline] |
| ValueSymbolTable& llvm::Function::getValueSymbolTable | ( | ) | [inline] |
getSymbolTable() - Return the symbol table...
Definition at line 326 of file Function.h.
Referenced by llvm::ilist_traits< Argument >::getSymTab(), llvm::ilist_traits< BasicBlock >::getSymTab(), and WriteFunction().
| const ValueSymbolTable& llvm::Function::getValueSymbolTable | ( | ) | const [inline] |
Definition at line 327 of file Function.h.
| iterator llvm::Function::begin | ( | ) | [inline] |
Definition at line 333 of file Function.h.
Referenced by llvm::Interpreter::callFunction(), llvm::CloneAndPruneFunctionInto(), llvm::CloneFunctionInto(), llvm::StableBasicBlockNumbering::compute(), dropAllReferences(), EvaluateFunction(), findFnRegionEndMarker(), getCommonReturnValue(), llvm::ValueEnumerator::incorporateFunction(), llvm::InlineFunction(), llvm::BasicInlinerImpl::inlineFunctions(), llvm::InsertProfilingInitCall(), isOnlyUsedInEntryBlock(), IterativeSimplifyCFG(), LinkFunctionBody(), LLVMGetBasicBlocks(), LLVMGetFirstBasicBlock(), LLVMGetLastBasicBlock(), LLVMGetPreviousBasicBlock(), llvm::GraphTraits< Function * >::nodes_begin(), llvm::GraphTraits< const Function * >::nodes_begin(), llvm::SparseSolver::Print(), llvm::MSILWriter::printFunctionBody(), RemoveUnreachableBlocksFromFn(), llvm::JIT::runFunction(), llvm::BasicBlockPass::runOnFunction(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::FunctionLoweringInfo::set(), llvm::DominanceFrontier::splitBlock(), ThunkGToF(), llvm::UpgradeIntrinsicCall(), and WriteFunction().
| const_iterator llvm::Function::begin | ( | ) | const [inline] |
Definition at line 334 of file Function.h.
| iterator llvm::Function::end | ( | ) | [inline] |
Definition at line 335 of file Function.h.
Referenced by llvm::CloneAndPruneFunctionInto(), llvm::CloneFunctionInto(), llvm::CloneTraceInto(), llvm::StableBasicBlockNumbering::compute(), dropAllReferences(), findFnRegionEndMarker(), getCommonReturnValue(), HandleInlinedInvoke(), llvm::ValueEnumerator::incorporateFunction(), llvm::InlineFunction(), llvm::BasicInlinerImpl::inlineFunctions(), IterativeSimplifyCFG(), LinkFunctionBody(), LLVMGetBasicBlocks(), LLVMGetFirstBasicBlock(), LLVMGetLastBasicBlock(), LLVMGetNextBasicBlock(), llvm::GraphTraits< const Function * >::nodes_end(), llvm::GraphTraits< Function * >::nodes_end(), llvm::SparseSolver::Print(), llvm::MSILWriter::printFunctionBody(), RemoveUnreachableBlocksFromFn(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::BasicBlockPass::runOnFunction(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::FunctionLoweringInfo::set(), llvm::DominanceFrontier::splitBlock(), and WriteFunction().
| const_iterator llvm::Function::end | ( | ) | const [inline] |
Definition at line 336 of file Function.h.
| size_t llvm::Function::size | ( | ) | const [inline] |
Definition at line 338 of file Function.h.
Referenced by llvm::InlineCostAnalyzer::getInlineCost(), hash(), and RemoveUnreachableBlocksFromFn().
| bool llvm::Function::empty | ( | ) | const [inline] |
Definition at line 339 of file Function.h.
| const BasicBlock& llvm::Function::front | ( | ) | const [inline] |
Definition at line 340 of file Function.h.
Referenced by getEntryBlock(), llvm::IntervalIterator< NodeTy, OrigContainer_t, GT, IGT >::IntervalIterator(), and llvm::AllocaInst::isStaticAlloca().
| BasicBlock& llvm::Function::front | ( | ) | [inline] |
Definition at line 341 of file Function.h.
| const BasicBlock& llvm::Function::back | ( | ) | const [inline] |
| BasicBlock& llvm::Function::back | ( | ) | [inline] |
Definition at line 343 of file Function.h.
| arg_iterator llvm::Function::arg_begin | ( | ) | [inline] |
Definition at line 348 of file Function.h.
Referenced by AllCalleesPassInValidPointerForArgument(), calculateFunctionInfo(), llvm::Interpreter::callFunction(), llvm::CloneAndPruneFunctionInto(), llvm::CloneFunction(), llvm::CloneFunctionInto(), llvm::CloneModule(), EnsureFPIntrinsicsExist(), equals(), EvaluateFunction(), ffiInvoke(), llvm::Argument::getArgNo(), llvm::ValueEnumerator::incorporateFunction(), llvm::InsertProfilingInitCall(), isDynamicConstant(), LinkFunctionBody(), LLVMGetFirstParam(), LLVMGetLastParam(), LLVMGetParams(), LLVMGetPreviousParam(), llvm::MSILWriter::printFunction(), llvm::MSILWriter::printModuleStartup(), llvm::FunctionLoweringInfo::set(), and ThunkGToF().
| const_arg_iterator llvm::Function::arg_begin | ( | ) | const [inline] |
Definition at line 352 of file Function.h.
| arg_iterator llvm::Function::arg_end | ( | ) | [inline] |
Definition at line 356 of file Function.h.
Referenced by calculateFunctionInfo(), llvm::Interpreter::callFunction(), llvm::CloneAndPruneFunctionInto(), llvm::CloneFunction(), llvm::CloneFunctionInto(), EnsureFPIntrinsicsExist(), equals(), EvaluateFunction(), ffiInvoke(), llvm::ValueEnumerator::incorporateFunction(), LinkFunctionBody(), LLVMGetFirstParam(), LLVMGetLastParam(), LLVMGetNextParam(), LLVMGetParams(), llvm::MSILWriter::printFunction(), llvm::FunctionLoweringInfo::set(), and ThunkGToF().
| const_arg_iterator llvm::Function::arg_end | ( | ) | const [inline] |
Definition at line 360 of file Function.h.
| size_t Function::arg_size | ( | ) | const |
Definition at line 194 of file Function.cpp.
References getFunctionType(), and llvm::FunctionType::getNumParams().
Referenced by llvm::Interpreter::callFunction(), llvm::CloneFunctionInto(), equals(), ffiInvoke(), llvm::PIC16TargetLowering::InitReservedFrameCount(), llvm::InsertProfilingInitCall(), and llvm::MSILWriter::printModuleStartup().
| bool Function::arg_empty | ( | ) | const |
Definition at line 197 of file Function.cpp.
References getFunctionType(), and llvm::FunctionType::getNumParams().
| void Function::viewCFG | ( | ) | const |
viewCFG - This function is meant for use from the debugger. You can just say 'call F->viewCFG()' and a ghostview window should pop up from the program, displaying the CFG of the current function with the code for each basic block inside. This depends on there being a 'dot' and 'gv' program in your path.
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. This depends on there being a 'dot' and 'gv' program in your path.
Definition at line 198 of file CFGPrinter.cpp.
References llvm::Value::getNameStr(), and llvm::ViewGraph().
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 207 of file CFGPrinter.cpp.
References llvm::Value::getNameStr(), and llvm::ViewGraph().
Referenced by LLVMViewFunctionCFGOnly().
Methods for support type inquiry through isa, cast, and dyn_cast:.
Definition at line 384 of file Function.h.
Reimplemented from llvm::GlobalValue.
Definition at line 385 of file Function.h.
References llvm::Value::FunctionVal, and llvm::Value::getValueID().
| 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 217 of file Function.cpp.
References begin(), E, and end().
Referenced by deleteBody(), and ~Function().
| bool Function::hasAddressTaken | ( | ) | const |
hasAddressTaken - returns true if there are any uses of this function other than direct calls or invokes to it.
Definition at line 384 of file Function.cpp.
References E, llvm::Value::use_begin(), and llvm::Value::use_end().
Referenced by fold().
friend class SymbolTableListTraits< Function, Module > [friend] |
Definition at line 91 of file Function.h.