LLVM API Documentation
#include <Function.h>
Inheritance diagram for llvm::Function:


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 |
| bool | isVarArg () const |
| virtual bool | isDeclaration () const |
| unsigned | getIntrinsicID (bool noAssert=false) const |
| bool | isIntrinsic () const |
| unsigned | getCallingConv () const |
| void | setCallingConv (unsigned CC) |
| const PAListPtr & | getParamAttrs () const |
| void | setParamAttrs (const PAListPtr &attrs) |
| bool | hasCollector () const |
| const char * | getCollector () const |
| void | setCollector (const char *Str) |
| void | clearCollector () |
| bool | paramHasAttr (unsigned i, ParameterAttributes attr) const |
| Determine whether the function has the given attribute. | |
| void | addParamAttr (unsigned i, ParameterAttributes attr) |
| addParamAttr - adds the attribute to the list of attributes. | |
| unsigned | getParamAlignment (unsigned i) const |
| Extract the alignment for a call or parameter (0=unknown). | |
| bool | doesNotReturn () const |
| Determine if the function cannot return. | |
| void | setDoesNotThrow (bool doesNotThrow=true) |
| bool | doesNotThrow () const |
| Determine if the function cannot unwind. | |
| bool | doesNotAccessMemory () const |
| Determine if the function does not access memory. | |
| bool | onlyReadsMemory () const |
| Determine if the function does not access or only reads memory. | |
| bool | hasStructRetAttr () const |
| Determine if the function returns a structure through first pointer argument. | |
| void | copyAttributesFrom (const GlobalValue *Src) |
| void | deleteBody () |
| void | removeFromParent () |
| 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 |
| virtual void | print (std::ostream &OS) const |
| void | print (std::ostream *OS) const |
| void | print (std::ostream &OS, AssemblyAnnotationWriter *AAW) const |
| void | viewCFG () const |
| void | viewCFGOnly () const |
| void | dropAllReferences () |
Static Public Member Functions | |
| Function * | Create (const FunctionType *Ty, LinkageTypes Linkage, const std::string &N="", Module *M=0) |
| bool | classof (const Function *) |
| Methods for support type inquiry through isa, cast, and dyn_cast:. | |
| bool | classof (const Value *V) |
| unsigned | getBasicBlockListOffset () |
| unsigned | getArgumentListOffset () |
Friends | |
| class | SymbolTableListTraits<Function, Module> |
|
|
Definition at line 63 of file Function.h. |
|
|
Definition at line 56 of file Function.h. Referenced by getArgumentList(). |
|
|
Definition at line 57 of file Function.h. Referenced by getBasicBlockList(). |
|
|
Definition at line 64 of file Function.h. |
|
|
Definition at line 61 of file Function.h. |
|
|
Definition at line 60 of file Function.h. Referenced by dropAllReferences(). |
|
|
Definition at line 181 of file Function.cpp. References llvm::iplist< NodeTy, Traits >::clear(), clearCollector(), and dropAllReferences(). |
|
||||||||||||
|
addParamAttr - adds the attribute to the list of attributes.
Definition at line 243 of file Function.cpp. References llvm::PAListPtr::addAttr(), getParamAttrs(), llvm::ParameterAttributes, and setParamAttrs(). |
|
|
Definition at line 279 of file Function.h. |
|
|
|
Definition at line 208 of file Function.cpp. References getFunctionType(), and llvm::FunctionType::getNumParams(). |
|
|
Definition at line 287 of file Function.h. |
|
|
|
Definition at line 205 of file Function.cpp. References getFunctionType(), and llvm::FunctionType::getNumParams(). Referenced by llvm::Interpreter::callFunction(), ExitOpt::CallOptimizer(), llvm::InlineFunction(), llvm::InsertProfilingInitCall(), LLVMCountParams(), MSILWriter::printModuleStartup(), and Verifier::visitFunction(). |
|
|
Definition at line 270 of file Function.h. |
|
|
Definition at line 269 of file Function.h. Referenced by EvaluateStaticConstructor(), llvm::InlineFunction(), llvm::CallGraphNode::removeAnyCallEdgeTo(), StripSymbols::runOnModule(), RaiseAllocations::runOnModule(), and DAE::runOnModule(). |
|
|
Definition at line 261 of file Function.h. |
|
|
|
Reimplemented from llvm::GlobalValue. Definition at line 316 of file Function.h. References llvm::Value::getValueID(). |
|
|
Methods for support type inquiry through isa, cast, and dyn_cast:.
Definition at line 315 of file Function.h. |
|
|
Definition at line 273 of file Function.cpp. References CollectorNamePool, CollectorNames, llvm::StringPool::empty(), llvm::DenseMap< KeyT, ValueT, KeyInfoT, ValueInfoT >::empty(), and llvm::DenseMap< KeyT, ValueT, KeyInfoT, ValueInfoT >::erase(). Referenced by LLVMSetCollector(), and ~Function(). |
|
|
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 289 of file Function.cpp. References llvm::GlobalValue::copyAttributesFrom(), getCallingConv(), getCollector(), getParamAttrs(), hasCollector(), setCallingConv(), setCollector(), and setParamAttrs(). Referenced by llvm::CloneFunctionInto(), llvm::CloneModule(), and GVExtractorPass::isolateGV(). |
|
||||||||||||||||||||
|
Definition at line 116 of file Function.h. Referenced by llvm::CloneFunction(), llvm::CloneModule(), and Module::getOrInsertFunction(). |
|
|
deleteBody - This method deletes the body of the function, and converts the linkage to external. Definition at line 214 of file Function.h. Referenced by GVExtractorPass::deleteGV(), llvm::BitcodeReader::dematerializeFunction(), and LinkFunctionProtos(). |
|
|
Determine if the function does not access memory.
Definition at line 192 of file Function.h. Referenced by llvm::AliasAnalysis::getModRefBehavior(). |
|
|
Determine if the function cannot return.
Definition at line 183 of file Function.h. Referenced by PruneEH::runOnSCC(). |
|
|
Determine if the function cannot unwind.
Definition at line 187 of file Function.h. Referenced by llvm::X86RegisterInfo::emitPrologue(), llvm::PPCRegisterInfo::emitPrologue(), and PruneEH::runOnSCC(). |
|
|
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 228 of file Function.cpp. References begin(), llvm::iplist< NodeTy, Traits >::clear(), Module::dropAllReferences(), end(), and iterator. Referenced by llvm::BasicBlock::dropAllReferences(), GVExtractorPass::isolateGV(), and ~Function(). |
|
|
Definition at line 266 of file Function.h. Referenced by llvm::CallGraphNode::empty(), llvm::MachineModuleInfo::hasDebugInfo(), and BlockExtractorPass::runOnModule(). |
|
|
Definition at line 263 of file Function.h. |
|
|
|
eraseFromParent - This method unlinks 'this' from the containing module and deletes it. Definition at line 148 of file Function.cpp. References Module::getFunctionList(), and llvm::GlobalValue::getParent(). Referenced by LinkAlias(), LinkFunctionProtos(), LLVMDeleteFunction(), StripSymbols::runOnModule(), StripDeadPrototypesPass::runOnModule(), CBackendNameAllUsedStructsAndMergeFunctions::runOnModule(), and llvm::UpgradeCallsToIntrinsic(). |
|
|
Definition at line 268 of file Function.h. |
|
|
Definition at line 267 of file Function.h. Referenced by PruningFunctionCloner::CloneBlock(), and llvm::IntervalIterator< NodeTy, OrigContainer_t, GT, IGT >::IntervalIterator(). |
|
|
Definition at line 237 of file Function.h. References ArgumentListType. |
|
|
Get the underlying elements of the Function... the basic block list is empty for external functions. Definition at line 233 of file Function.h. References ArgumentListType. Referenced by llvm::Argument::Argument(). |
|
|
Definition at line 338 of file Function.h. References ArgumentList. |
|
|
Definition at line 243 of file Function.h. References BasicBlockListType. |
|
|
|
Definition at line 334 of file Function.h. References BasicBlocks. |
|
|
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 149 of file Function.h. Referenced by calculateFunctionInfo(), copyAttributesFrom(), llvm::X86IntelAsmPrinter::decorateName(), llvm::X86ATTAsmPrinter::decorateName(), llvm::PPCRegisterInfo::emitEpilogue(), llvm::InlineCostAnalyzer::getInlineCost(), MSILWriter::getLibraryName(), llvm::X86TargetLowering::IsEligibleForTailCallOptimization(), llvm::PPCTargetLowering::IsEligibleForTailCallOptimization(), LLVMGetFunctionCallConv(), llvm::TargetLowering::LowerArguments(), LowerRET(), MSILWriter::printExternals(), MSILWriter::printFunction(), MSILWriter::printModuleStartup(), MSILWriter::printValueLoad(), llvm::X86IntelAsmPrinter::runOnMachineFunction(), and llvm::X86ATTAsmPrinter::runOnMachineFunction(). |
|
|
Definition at line 260 of file Function.cpp. References hasCollector(). Referenced by copyAttributesFrom(), llvm::CollectorModuleMetadata::get(), llvm::InlineFunction(), and LLVMGetCollector(). |
|
|
Definition at line 246 of file Function.h. |
|
|
|
|
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. Definition at line 306 of file Function.cpp. References llvm::StringMapEntry< ValueTy >::getKeyData(), llvm::StringMapEntryBase::getKeyLength(), llvm::Value::getValueName(), and llvm::ValueName. Referenced by llvm::canConstantFoldCallTo(), llvm::IntrinsicInst::classof(), llvm::SourceFunctionInfo::getSourceLocation(), CodeExtractor::isEligible(), LLVMGetIntrinsicID(), llvm::IntrinsicLowering::LowerIntrinsicCall(), EscapeEnumerator::Next(), llvm::UpgradeIntrinsicCall(), llvm::UpgradeIntrinsicFunction(), llvm::SelectionDAGLowering::visitCall(), Verifier::visitCallInst(), and llvm::Interpreter::visitCallSite(). |
|
|
Extract the alignment for a call or parameter (0=unknown).
Definition at line 178 of file Function.h. References llvm::PAListPtr::getParamAlignment(). Referenced by llvm::TargetLowering::LowerArguments(). |
|
|
getParamAttrs - Return the parameter attributes for this Function. Definition at line 156 of file Function.h. Referenced by addParamAttr(), copyAttributesFrom(), llvm::ValueEnumerator::incorporateFunction(), RemoveNestAttribute(), setDoesNotThrow(), llvm::UpgradeIntrinsicCall(), Verifier::VerifyIntrinsicPrototype(), and Verifier::visitFunction(). |
|
|
|
Definition at line 254 of file Function.h. |
|
|
getSymbolTable() - Return the symbol table... Definition at line 253 of file Function.h. Referenced by getSymTab(), llvm::ilist_traits< Argument >::getSymTab(), llvm::ilist_traits< BasicBlock >::getSymTab(), and WriteFunction(). |
|
|
hasCollector/getCollector/setCollector/clearCollector - The name of the garbage collection algorithm to use during code generation. Definition at line 256 of file Function.cpp. References CollectorNames, and llvm::DenseMap< KeyT, ValueT, KeyInfoT, ValueInfoT >::count(). Referenced by copyAttributesFrom(), llvm::CollectorModuleMetadata::get(), getCollector(), llvm::InlineFunction(), LLVMGetCollector(), llvm::SelectionDAGISel::runOnFunction(), Printer::runOnFunction(), LowerIntrinsics::runOnFunction(), MachineCodeAnalysis::runOnMachineFunction(), and Verifier::visitIntrinsicFunctionCall(). |
|
|
Determine if the function returns a structure through first pointer argument.
Definition at line 203 of file Function.h. Referenced by llvm::X86IntelAsmPrinter::decorateName(), and llvm::X86ATTAsmPrinter::decorateName(). |
|
|
|
Definition at line 144 of file Function.h. Referenced by LowerSetJmp::visitCallInst(), Verifier::visitInstruction(), and LowerSetJmp::visitInvokeInst(). |
|
|
isVarArg - Return true if this function takes a variable number of arguments. Definition at line 136 of file Function.cpp. References getFunctionType(), and llvm::FunctionType::isVarArg(). Referenced by llvm::SparcTargetLowering::LowerArguments(), llvm::TargetLowering::LowerArguments(), llvm::IA64TargetLowering::LowerArguments(), LowerRET(), and MSILWriter::printFunction(). |
|
|
Determine if the function does not access or only reads memory.
Definition at line 197 of file Function.h. Referenced by llvm::AliasAnalysis::getModRefBehavior(), and llvm::InlineFunction(). |
|
||||||||||||
|
Determine whether the function has the given attribute.
Definition at line 170 of file Function.h. References llvm::ParameterAttributes, and llvm::PAListPtr::paramHasAttr(). Referenced by calculateFunctionInfo(), llvm::Argument::hasByValAttr(), llvm::Argument::hasNoAliasAttr(), llvm::Argument::hasStructRetAttr(), llvm::InlineFunction(), llvm::TargetLowering::LowerArguments(), llvm::InvokeInst::paramHasAttr(), MSILWriter::printFunction(), and llvm::SelectionDAGLowering::visitRet(). |
|
||||||||||||