LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

llvm::Function Class Reference

#include <Function.h>

Inheritance diagram for llvm::Function:

Inheritance graph
[legend]
Collaboration diagram for llvm::Function:

Collaboration graph
[legend]
List of all members.

Public Types

typedef iplist< ArgumentArgumentListType
typedef iplist< BasicBlockBasicBlockListType
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 TypegetReturnType () const
const FunctionTypegetFunctionType () 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 PAListPtrgetParamAttrs () 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 ArgumentListTypegetArgumentList () const
ArgumentListTypegetArgumentList ()
const BasicBlockListTypegetBasicBlockList () const
BasicBlockListTypegetBasicBlockList ()
const BasicBlockgetEntryBlock () const
BasicBlockgetEntryBlock ()
ValueSymbolTablegetValueSymbolTable ()
const ValueSymbolTablegetValueSymbolTable () const
iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const
size_t size () const
bool empty () const
const BasicBlockfront () const
BasicBlockfront ()
const BasicBlockback () const
BasicBlockback ()
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

FunctionCreate (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>

Member Typedef Documentation

typedef ArgumentListType::iterator llvm::Function::arg_iterator
 

Definition at line 63 of file Function.h.

typedef iplist<Argument> llvm::Function::ArgumentListType
 

Definition at line 56 of file Function.h.

Referenced by getArgumentList().

typedef iplist<BasicBlock> llvm::Function::BasicBlockListType
 

Definition at line 57 of file Function.h.

Referenced by getBasicBlockList().

typedef ArgumentListType::const_iterator llvm::Function::const_arg_iterator
 

Definition at line 64 of file Function.h.

typedef BasicBlockListType::const_iterator llvm::Function::const_iterator
 

Definition at line 61 of file Function.h.

typedef BasicBlockListType::iterator llvm::Function::iterator
 

Definition at line 60 of file Function.h.

Referenced by dropAllReferences().


Constructor & Destructor Documentation

Function::~Function  ) 
 

Definition at line 181 of file Function.cpp.

References llvm::iplist< NodeTy, Traits >::clear(), clearCollector(), and dropAllReferences().


Member Function Documentation

void Function::addParamAttr unsigned  i,
ParameterAttributes  attr
 

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().

const_arg_iterator llvm::Function::arg_begin  )  const [inline]
 

Definition at line 279 of file Function.h.

arg_iterator llvm::Function::arg_begin  )  [inline]
 

Definition at line 275 of file Function.h.

Referenced by AllCalleesPassInValidPointerForArgument(), calculateFunctionInfo(), llvm::Interpreter::callFunction(), llvm::CloneAndPruneFunctionInto(), llvm::CloneFunction(), llvm::CloneFunctionInto(), llvm::CloneModule(), EvaluateFunction(), llvm::FunctionLoweringInfo::FunctionLoweringInfo(), llvm::Argument::getArgNo(), DSE::handleEndBlock(), llvm::Argument::hasStructRetAttr(), llvm::ValueEnumerator::incorporateFunction(), llvm::InlineFunction(), llvm::InsertProfilingInitCall(), isDynamicConstant(), LinkFunctionBody(), LLVMGetFirstParam(), LLVMGetLastParam(), LLVMGetParam(), LLVMGetParams(), LLVMGetPreviousParam(), llvm::SparcTargetLowering::LowerArguments(), llvm::TargetLowering::LowerArguments(), llvm::IA64TargetLowering::LowerArguments(), LowerPartSelect(), LowerPartSet(), MSILWriter::printFunction(), CppWriter::printInline(), MSILWriter::printModuleStartup(), SCCP::runOnFunction(), GCSE::runOnFunction(), AAEval::runOnFunction(), IndMemRemPass::runOnModule(), and DAE::runOnModule().

bool Function::arg_empty  )  const
 

Definition at line 208 of file Function.cpp.

References getFunctionType(), and llvm::FunctionType::getNumParams().

const_arg_iterator llvm::Function::arg_end  )  const [inline]
 

Definition at line 287 of file Function.h.

arg_iterator llvm::Function::arg_end  )  [inline]
 

Definition at line 283 of file Function.h.

Referenced by calculateFunctionInfo(), llvm::Interpreter::callFunction(), llvm::CloneAndPruneFunctionInto(), llvm::CloneFunction(), llvm::CloneFunctionInto(), llvm::CloneModule(), EvaluateFunction(), llvm::FunctionLoweringInfo::FunctionLoweringInfo(), DSE::handleEndBlock(), llvm::ValueEnumerator::incorporateFunction(), llvm::InlineFunction(), LinkFunctionBody(), LLVMGetFirstParam(), LLVMGetLastParam(), LLVMGetNextParam(), LLVMGetParams(), llvm::SparcTargetLowering::LowerArguments(), llvm::TargetLowering::LowerArguments(), llvm::IA64TargetLowering::LowerArguments(), MSILWriter::printFunction(), CppWriter::printInline(), SCCP::runOnFunction(), GCSE::runOnFunction(), AAEval::runOnFunction(), and DAE::runOnModule().

size_t Function::arg_size  )  const
 

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().

BasicBlock& llvm::Function::back  )  [inline]
 

Definition at line 270 of file Function.h.

const BasicBlock& llvm::Function::back  )  const [inline]
 

Definition at line 269 of file Function.h.

Referenced by EvaluateStaticConstructor(), llvm::InlineFunction(), llvm::CallGraphNode::removeAnyCallEdgeTo(), StripSymbols::runOnModule(), RaiseAllocations::runOnModule(), and DAE::runOnModule().

const_iterator llvm::Function::begin  )  const [inline]
 

Definition at line 261 of file Function.h.

iterator llvm::Function::begin  )  [inline]
 

Definition at line 260 of file Function.h.

Referenced by llvm::CallGraphNode::begin(), llvm::Interpreter::callFunction(), llvm::CloneAndPruneFunctionInto(), llvm::CloneFunctionInto(), llvm::StableBasicBlockNumbering::compute(), GVExtractorPass::deleteGV(), InstCombiner::DoOneIteration(), dropAllReferences(), ProfilerRS::Duplicate(), EvaluateFunction(), llvm::FunctionLoweringInfo::FunctionLoweringInfo(), getCommonReturnValue(), DSE::handleEndBlock(), llvm::ValueEnumerator::incorporateFunction(), llvm::InlineFunction(), llvm::BasicInlinerImpl::inlineFunctions(), llvm::InsertProfilingInitCall(), isOnlyUsedInEntryBlock(), IterativeSimplifyCFG(), LLVMGetBasicBlocks(), LLVMGetFirstBasicBlock(), LLVMGetLastBasicBlock(), LLVMGetPreviousBasicBlock(), EscapeEnumerator::Next(), llvm::GraphTraits< const Function * >::nodes_begin(), llvm::GraphTraits< Function * >::nodes_begin(), GlobalRandomCounterOpt::PrepFunction(), llvm::SparseSolver::Print(), MSILWriter::printFunctionBody(), CppWriter::printInline(), RemoveUnreachableBlocks(), SCCPSolver::ResolvedUndefsIn(), PromoteMem2Reg::run(), PreVerifier::runOnFunction(), llvm::UnifyFunctionExitNodes::runOnFunction(), TailCallElim::runOnFunction(), SimplifyLibCalls::runOnFunction(), llvm::SelectionDAGISel::runOnFunction(), SCCP::runOnFunction(), RegToMem::runOnFunction(), Reassociate::runOnFunction(), BBPassManager::runOnFunction(), llvm::BasicBlockPass::runOnFunction(), LowerSwitch::runOnFunction(), LoopSimplify::runOnFunction(), JumpThreading::runOnFunction(), DSE::runOnFunction(), CondProp::runOnFunction(), CodeGenPrepare::runOnFunction(), BreakCriticalEdges::runOnFunction(), BlockPlacement::runOnFunction(), IPSCCP::runOnModule(), LowerSetJmp::runOnModule(), BlockExtractorPass::runOnModule(), PruneEH::runOnSCC(), llvm::Inliner::runOnSCC(), PruneEH::SimplifyFunction(), llvm::DominanceFrontier::splitBlock(), llvm::UpgradeIntrinsicCall(), llvm::UpgradeMultipleReturnValues(), and WriteFunction().

bool llvm::Function::classof const Value V  )  [inline, static]
 

Reimplemented from llvm::GlobalValue.

Definition at line 316 of file Function.h.

References llvm::Value::getValueID().

bool llvm::Function::classof const Function  )  [inline, static]
 

Methods for support type inquiry through isa, cast, and dyn_cast:.

Definition at line 315 of file Function.h.

void Function::clearCollector  ) 
 

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().

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 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().

Function* llvm::Function::Create const FunctionType Ty,
LinkageTypes  Linkage,
const std::string &  N = "",
Module M = 0
[inline, static]
 

Definition at line 116 of file Function.h.

Referenced by llvm::CloneFunction(), llvm::CloneModule(), and Module::getOrInsertFunction().

void llvm::Function::deleteBody  )  [inline]
 

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().

bool llvm::Function::doesNotAccessMemory  )  const [inline]
 

Determine if the function does not access memory.

Definition at line 192 of file Function.h.

Referenced by llvm::AliasAnalysis::getModRefBehavior().

bool llvm::Function::doesNotReturn  )  const [inline]
 

Determine if the function cannot return.

Definition at line 183 of file Function.h.

Referenced by PruneEH::runOnSCC().

bool llvm::Function::doesNotThrow  )  const [inline]
 

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().

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 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().

bool llvm::Function::empty  )  const [inline]
 

Definition at line 266 of file Function.h.

Referenced by llvm::CallGraphNode::empty(), llvm::MachineModuleInfo::hasDebugInfo(), and BlockExtractorPass::runOnModule().

const_iterator llvm::Function::end  )  const [inline]
 

Definition at line 263 of file Function.h.

iterator llvm::Function::end  )  [inline]
 

Definition at line 262 of file Function.h.

Referenced by llvm::CloneAndPruneFunctionInto(), llvm::CloneFunctionInto(), llvm::CloneTraceInto(), llvm::StableBasicBlockNumbering::compute(), GVExtractorPass::deleteGV(), InstCombiner::DoOneIteration(), dropAllReferences(), ProfilerRS::Duplicate(), llvm::CallGraphNode::end(), llvm::FunctionLoweringInfo::FunctionLoweringInfo(), GetAllUndefinedSymbols(), getCommonReturnValue(), HandleInlinedInvoke(), llvm::ValueEnumerator::incorporateFunction(), llvm::InlineFunction(), llvm::BasicInlinerImpl::inlineFunctions(), IterativeSimplifyCFG(), LLVMGetBasicBlocks(), LLVMGetFirstBasicBlock(), LLVMGetLastBasicBlock(), LLVMGetNextBasicBlock(), EscapeEnumerator::Next(), llvm::GraphTraits< const Function * >::nodes_end(), llvm::GraphTraits< Function * >::nodes_end(), GlobalRandomCounterOpt::PrepFunction(), llvm::SparseSolver::Print(), MSILWriter::printFunctionBody(), RemoveUnreachableBlocks(), SCCPSolver::ResolvedUndefsIn(), PromoteMem2Reg::run(), PreVerifier::runOnFunction(), llvm::UnifyFunctionExitNodes::runOnFunction(), TailCallElim::runOnFunction(), SimplifyLibCalls::runOnFunction(), llvm::SelectionDAGISel::runOnFunction(), SCCP::runOnFunction(), RegToMem::runOnFunction(), Reassociate::runOnFunction(), BBPassManager::runOnFunction(), llvm::BasicBlockPass::runOnFunction(), LowerSwitch::runOnFunction(), LoopSimplify::runOnFunction(), JumpThreading::runOnFunction(), DSE::runOnFunction(), CondProp::runOnFunction(), CodeGenPrepare::runOnFunction(), BreakCriticalEdges::runOnFunction(), IPSCCP::runOnModule(), RaiseAllocations::runOnModule(), LowerSetJmp::runOnModule(), BlockExtractorPass::runOnModule(), PruneEH::runOnSCC(), llvm::Inliner::runOnSCC(), PruneEH::SimplifyFunction(), llvm::DominanceFrontier::splitBlock(), llvm::UpgradeMultipleReturnValues(), and WriteFunction().

void Function::eraseFromParent  ) 
 

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().

BasicBlock& llvm::Function::front  )  [inline]
 

Definition at line 268 of file Function.h.

const BasicBlock& llvm::Function::front  )  const [inline]
 

Definition at line 267 of file Function.h.

Referenced by PruningFunctionCloner::CloneBlock(), and llvm::IntervalIterator< NodeTy, OrigContainer_t, GT, IGT >::IntervalIterator().

ArgumentListType& llvm::Function::getArgumentList  )  [inline]
 

Definition at line 237 of file Function.h.

References ArgumentListType.

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 233 of file Function.h.

References ArgumentListType.

Referenced by llvm::Argument::Argument().

unsigned llvm::Function::getArgumentListOffset  )  [inline, static]
 

Definition at line 338 of file Function.h.

References ArgumentList.

BasicBlockListType& llvm::Function::getBasicBlockList  )  [inline]
 

Definition at line 243 of file Function.h.

References BasicBlockListType.

const BasicBlockListType& llvm::Function::getBasicBlockList  )  const [inline]
 

Definition at line 242 of file Function.h.

References BasicBlockListType.

Referenced by llvm::CloneAndPruneFunctionInto(), llvm::CloneLoop(), llvm::BasicBlock::eraseFromParent(), llvm::InlineFunction(), LinkFunctionBody(), llvm::BasicBlock::moveAfter(), llvm::BasicBlock::moveBefore(), llvm::BasicBlock::removeFromParent(), RemoveUnreachableBlocks(), llvm::SimplifyCFG(), llvm::SplitCriticalEdge(), and llvm::UnrollLoop().

unsigned llvm::Function::getBasicBlockListOffset  )  [inline, static]
 

Definition at line 334 of file Function.h.

References BasicBlocks.

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 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().

const char * Function::getCollector  )  const
 

Definition at line 260 of file Function.cpp.

References hasCollector().

Referenced by copyAttributesFrom(), llvm::CollectorModuleMetadata::get(), llvm::InlineFunction(), and LLVMGetCollector().

BasicBlock& llvm::Function::getEntryBlock  )  [inline]
 

Definition at line 246 of file Function.h.

const BasicBlock& llvm::Function::getEntryBlock  )  const [inline]
 

Definition at line 245 of file Function.h.

Referenced by CheckForEscapingAllocas(), llvm::CloneAndPruneFunctionInto(), llvm::CloneBasicBlock(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), ProfilerRS::Duplicate(), getBackEdges(), llvm::GraphTraits< Inverse< const Function * > >::getEntryNode(), llvm::GraphTraits< Inverse< Function * > >::getEntryNode(), llvm::GraphTraits< const Function * >::getEntryNode(), llvm::GraphTraits< Function * >::getEntryNode(), llvm::ProfileInfo::getExecutionCount(), llvm::PHINode::hasConstantValue(), llvm::InlineFunction(), llvm::SCEVExpander::InsertCastOfTo(), llvm::SelectionDAGLowering::isExportableFromCurrentBlock(), ShadowStackCollector::performCustomLowering(), SROA::performPromotion(), SROA::performScalarRepl(), GlobalRandomCounterOpt::PrepFunction(), llvm::SelectionDAGISel::runOnFunction(), ProfilerRS::runOnFunction(), RegToMem::runOnFunction(), PromotePass::runOnFunction(), LoopExtractor::runOnFunction(), llvm::SimplifyCFG(), llvm::SparseSolver::Solve(), SplitEdgeNicely(), ProfilerRS::Translate(), TryToSinkInstruction(), and Verifier::visitInstruction().

const FunctionType * Function::getFunctionType  )  const
 

Definition at line 132 of file Function.cpp.

References llvm::SequentialType::getElementType(), and llvm::GlobalValue::getType().

Referenced by arg_empty(), arg_size(), llvm::Interpreter::callExternalFunction(), llvm::Interpreter::callFunction(), FPrintFOpt::CallOptimizer(), FPutsOpt::CallOptimizer(), FWriteOpt::CallOptimizer(), SPrintFOpt::CallOptimizer(), PrintFOpt::CallOptimizer(), ToAsciiOpt::CallOptimizer(), AbsOpt::CallOptimizer(), IsAsciiOpt::CallOptimizer(), IsDigitOpt::CallOptimizer(), FFSOpt::CallOptimizer(), UnaryDoubleFPOpt::CallOptimizer(), Exp2Opt::CallOptimizer(), PowOpt::CallOptimizer(), MemCpyOpt::CallOptimizer(), MemCmpOpt::CallOptimizer(), StrLenOpt::CallOptimizer(), StrCpyOpt::CallOptimizer(), StrNCmpOpt::CallOptimizer(), StrCmpOpt::CallOptimizer(), StrChrOpt::CallOptimizer(), StrCatOpt::CallOptimizer(), llvm::CloneFunction(), llvm::X86IntelAsmPrinter::decorateName(), llvm::X86ATTAsmPrinter::decorateName(), RaiseAllocations::doInitialization(), EvaluateFunction(), getReturnType(), llvm::InlineFunction(), isVarArg(), LinkFunctionProtos(), lookupFunction(), LowerPartSelect(), LowerPartSet(), MSILWriter::printExternals(), MSILWriter::printFunctionCall(), MSILWriter::printValueLoad(), llvm::JIT::runFunction(), llvm::Interpreter::runFunction(), llvm::ExecutionEngine::runFunctionAsMain(), TailCallElim::runOnFunction(), BlockExtractorPass::runOnModule(), IndMemRemPass::runOnModule(), DAE::runOnModule(), llvm::UpgradeIntrinsicCall(), UpgradeIntrinsicFunction1(), Verifier::VerifyIntrinsicPrototype(), and Verifier::visitFunction().

unsigned Function::getIntrinsicID bool  noAssert = false  )  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.

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().

unsigned llvm::Function::getParamAlignment unsigned  i  )  const [inline]
 

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().

const PAListPtr& llvm::Function::getParamAttrs  )  const [inline]
 

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().

const Type * Function::getReturnType  )  const
 

Definition at line 140 of file Function.cpp.

References getFunctionType(), and llvm::FunctionType::getReturnType().

Referenced by SCCPSolver::AddTrackedFunction(), llvm::Interpreter::callFunction(), llvm::ConstantFoldCall(), getCommonReturnValue(), llvm::InlineFunction(), llvm::IA64TargetLowering::LowerArguments(), MSILWriter::printFunction(), MSILWriter::printModuleStartup(), llvm::RemoveSuccessor(), llvm::UnifyFunctionExitNodes::runOnFunction(), IPSCCP::runOnModule(), llvm::UpgradeIntrinsicCall(), and Verifier::visitReturnInst().

const ValueSymbolTable& llvm::Function::getValueSymbolTable  )  const [inline]
 

Definition at line 254 of file Function.h.

ValueSymbolTable& llvm::Function::getValueSymbolTable  )  [inline]
 

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().

bool Function::hasCollector  )  const
 

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().

bool llvm::Function::hasStructRetAttr  )  const [inline]
 

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().

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 134 of file Function.h.

Referenced by llvm::Interpreter::callFunction(), llvm::CannotBeNegativeZero(), GVExtractorPass::deleteGV(), llvm::BitcodeReader::dematerializeFunction(), RaiseAllocations::doInitialization(), EvaluateFunction(), GetAllUndefinedSymbols(), JITResolver::getFunctionStub(), Andersens::getModRefInfo(), llvm::JIT::getPointerToFunction(), llvm::InlineFunction(), llvm::BasicInlinerImpl::inlineFunctions(), LinkAlias(), LinkFunctionBodies(), LinkFunctionBody(), LinkFunctionProtos(), LowerPartSelect(), LowerPartSet(), CppWriter::printFunctions(), CppWriter::printInline(), MSILWriter::printModuleStartup(), IA64AsmPrinter::printOp(), llvm::FunctionPass::run(), SimplifyLibCalls::runOnFunction(), ProfilerRS::runOnFunction(), RegToMem::runOnFunction(), llvm::FPPassManager::runOnFunction(), BBPassManager::runOnFunction(), MSILWriter::runOnFunction(), StripDeadPrototypesPass::runOnModule(), InternalizePass::runOnModule(), IndMemRemPass::runOnModule(), CBackendNameAllUsedStructsAndMergeFunctions::runOnModule(), PruneEH::runOnSCC(), llvm::Inliner::runOnSCC(), llvm::verifyFunction(), llvm::SelectionDAGLowering::visitCall(), llvm::Interpreter::visitCallSite(), and Verifier::visitIntrinsicFunctionCall().

bool llvm::Function::isIntrinsic  )  const [inline]
 

Definition at line 144 of file Function.h.

Referenced by LowerSetJmp::visitCallInst(), Verifier::visitInstruction(), and LowerSetJmp::visitInvokeInst().

bool Function::isVarArg  )  const
 

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().

bool llvm::Function::onlyReadsMemory  )  const [inline]
 

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().

bool llvm::Function::paramHasAttr unsigned  i,
ParameterAttributes  attr
const [inline]
 

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().

void Function::print std::ostream &  OS,
AssemblyAnnotationWriter AAW
const