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 std::reverse_iterator< const_iterator > | const_reverse_iterator |
typedef std::reverse_iterator< iterator > | reverse_iterator |
typedef ArgumentListType::iterator | aiterator |
typedef ArgumentListType::const_iterator | const_aiterator |
typedef std::reverse_iterator< const_aiterator > | const_reverse_aiterator |
typedef std::reverse_iterator< aiterator > | reverse_aiterator |
Public Member Functions | |
Function (const FunctionType *Ty, LinkageTypes Linkage, const std::string &N="", Module *M=0) | |
~Function () | |
virtual void | setName (const std::string &name, SymbolTable *ST=0) |
const Type * | getReturnType () const |
const FunctionType * | getFunctionType () const |
virtual bool | isExternal () const |
unsigned | getIntrinsicID () const |
bool | isIntrinsic () const |
void | renameLocalSymbols () |
void | deleteBody () |
void | removeFromParent () |
void | eraseFromParent () |
Function * | getNext () |
const Function * | getNext () const |
Function * | getPrev () |
const Function * | getPrev () const |
const ArgumentListType & | getArgumentList () const |
ArgumentListType & | getArgumentList () |
const BasicBlockListType & | getBasicBlockList () const |
BasicBlockListType & | getBasicBlockList () |
const BasicBlock & | getEntryBlock () const |
BasicBlock & | getEntryBlock () |
SymbolTable & | getSymbolTable () |
const SymbolTable & | getSymbolTable () const |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
size_t | size () const |
bool | empty () const |
const BasicBlock & | front () const |
BasicBlock & | front () |
const BasicBlock & | back () const |
BasicBlock & | back () |
aiterator | abegin () |
const_aiterator | abegin () const |
aiterator | aend () |
const_aiterator | aend () const |
reverse_aiterator | arbegin () |
const_reverse_aiterator | arbegin () const |
reverse_aiterator | arend () |
const_reverse_aiterator | arend () const |
size_t | asize () const |
bool | aempty () const |
const Argument & | afront () const |
Argument & | afront () |
const Argument & | aback () const |
Argument & | aback () |
virtual 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 | |
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, Module > |
Definition at line 48 of file Function.h.
|
Definition at line 59 of file Function.h. |
|
Definition at line 50 of file Function.h. |
|
Definition at line 51 of file Function.h. |
|
Definition at line 60 of file Function.h. |
|
Definition at line 55 of file Function.h. |
|
Definition at line 61 of file Function.h. |
|
Definition at line 56 of file Function.h. |
|
Definition at line 54 of file Function.h. |
|
Definition at line 62 of file Function.h. |
|
Definition at line 57 of file Function.h. |
|
Function ctor - If the (optional) Module argument is specified, the function is automatically inserted into the end of the function list for the module. Definition at line 88 of file Function.cpp. References llvm::LeakDetector::addGarbageObject(), llvm::Module::getFunctionList(), llvm::FunctionType::getNumParams(), llvm::FunctionType::getParamType(), getReturnType(), and llvm::Type::VoidTy. |
|
Definition at line 114 of file Function.cpp. References dropAllReferences(). |
|
Definition at line 203 of file Function.h. |
|
Definition at line 202 of file Function.h. |
|
Definition at line 189 of file Function.h. |
|
|
Definition at line 199 of file Function.h. |
|
Definition at line 191 of file Function.h. |
|
|
Definition at line 201 of file Function.h. |
|
Definition at line 200 of file Function.h. |
|
Definition at line 194 of file Function.h. |
|
Definition at line 193 of file Function.h. |
|
Definition at line 196 of file Function.h. |
|
Definition at line 195 of file Function.h. |
|
Definition at line 198 of file Function.h. Referenced by llvm::Interpreter::callFunction(), CheckVarargs(), and llvm::InsertProfilingInitCall(). |
|
Definition at line 183 of file Function.h. |
|
Definition at line 182 of file Function.h. Referenced by llvm::InlineFunction(). |
|
Definition at line 169 of file Function.h. |
|
|
Reimplemented from llvm::GlobalValue. Definition at line 225 of file Function.h. References llvm::Value::FunctionVal, and llvm::Value::getValueType(). |
|
Methods for support type inquiry through isa, cast, and dyn_cast:.
Definition at line 224 of file Function.h. |
|
deleteBody - This method deletes the body of the function, and converts the linkage to external. Definition at line 119 of file Function.h. References dropAllReferences(), llvm::GlobalValue::ExternalLinkage, and llvm::GlobalValue::setLinkage(). |
|
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 205 of file Function.cpp. References begin(), E, end(), and I. Referenced by deleteBody(), and ~Function(). |
|
Definition at line 179 of file Function.h. |
|
Definition at line 171 of file Function.h. |
|
|
eraseFromParent - This method unlinks 'this' from the containing module and deletes it. Definition at line 153 of file Function.cpp. References llvm::Module::getFunctionList(), and llvm::GlobalValue::getParent(). |
|
Definition at line 181 of file Function.h. |
|
|
Definition at line 148 of file Function.h. |
|
Get the underlying elements of the Function... the basic block list is empty for external functions. Definition at line 147 of file Function.h. Referenced by llvm::Argument::Argument(). |
|
Definition at line 151 of file Function.h. |
|
Definition at line 150 of file Function.h. Referenced by llvm::BasicBlock::BasicBlock(), llvm::BasicBlock::eraseFromParent(), getBBVal(), llvm::InlineFunction(), LinkFunctionBody(), llvm::BytecodeReader::ParseInstructionList(), llvm::BasicBlock::removeFromParent(), llvm::SimplifyCFG(), and llvm::SplitCriticalEdge(). |
|
Definition at line 154 of file Function.h. References front(). |
|
|
|
|
Definition at line 140 of file Function.h. References Next(). |
|
Definition at line 139 of file Function.h. References Next(). |
|
Definition at line 142 of file Function.h. |
|
Definition at line 141 of file Function.h. |
|
Definition at line 145 of file Function.cpp. References getFunctionType(), and llvm::FunctionType::getReturnType(). Referenced by CallersAllIgnoreReturnValue(), llvm::Interpreter::callFunction(), llvm::ConstantFoldCall(), Function(), llvm::InlineFunction(), InsertCodeToShowFunctionExit(), and llvm::UnifyFunctionExitNodes::runOnFunction(). |
|
Definition at line 162 of file Function.h. |
|
getSymbolTable() - Return the symbol table... Definition at line 161 of file Function.h. Referenced by lookupInSymbolTable(), renameLocalSymbols(), llvm::Instruction::setName(), setName(), llvm::Argument::setName(), llvm::BasicBlock::setName(), and setValueName(). |
|
isExternal - Is the body of this function unknown? (The basic block list is empty if so.) This is true for external functions, defined as forward "declare"ations Implements llvm::GlobalValue. Definition at line 97 of file Function.h. Referenced by llvm::Interpreter::callFunction(), llvm::JIT::getPointerToFunction(), llvm::InlineFunction(), llvm::DSCallSiteIterator::isUnresolvableFunc(), LinkFunctionBodies(), LinkFunctionBody(), LinkFunctionProtos(), ProcessGlobalsWithSameName(), removeIdenticalCalls(), llvm::FunctionPass::run(), llvm::ProfilePaths::runOnFunction(), llvm::MemoryDepAnalysis::runOnFunction(), llvm::Inliner::runOnSCC(), and llvm::verifyFunction(). |
|
Definition at line 107 of file Function.h. References getIntrinsicID(). |
|
Definition at line 1200 of file AsmWriter.cpp. References llvm::GlobalValue::getParent(), and llvm::AssemblyWriter::write(). |
|
print - Implement operator<< on Value... Reimplemented from llvm::Constant. Definition at line 205 of file Function.h. |
|
Definition at line 174 of file Function.h. |
|
Definition at line 173 of file Function.h. |
|
removeFromParent - This method unlinks 'this' from the containing module, but does not delete it. Definition at line 149 of file Function.cpp. References llvm::Module::getFunctionList(), and llvm::GlobalValue::getParent(). |
|
renameLocalSymbols - This method goes through the Function's symbol table and renames any symbols that conflict with symbols at global scope. This is required before printing out to a textual form, to ensure that there is no ambiguity when parsing. Definition at line 162 of file Function.cpp. References E, llvm::SymbolTable::find(), llvm::GlobalValue::getParent(), llvm::Module::getSymbolTable(), getSymbolTable(), llvm::SymbolTable::plane_begin(), llvm::SymbolTable::plane_end(), llvm::Value::setName(), llvm::utostr(), and V. |
|
Definition at line 176 of file Function.h. |
|
Definition at line 175 of file Function.h. |
|
Reimplemented from llvm::Constant. Definition at line 124 of file Function.cpp. References llvm::GlobalValue::getParent(), llvm::Module::getSymbolTable(), getSymbolTable(), llvm::Value::hasName(), llvm::SymbolTable::insert(), llvm::SymbolTable::remove(), and llvm::Value::setName(). Referenced by CheckVarargs(), and Cilkifier::TransformFunc(). |
|
Definition at line 178 of file Function.h. Referenced by llvm::getBBtrace(), and getIntrinsicID(). |
|
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. Definition at line 139 of file CFGPrinter.cpp. References F, llvm::Value::getName(), and llvm::WriteGraph(). Referenced by viewCFGOnly(). |
|
viewCFGOnly - This function is meant for use from the debugger. It works just like viewCFG, but it does not include the contents of basic blocks into the nodes, just the label. If you are only interested in the CFG this can make the graph smaller. Definition at line 169 of file CFGPrinter.cpp. |
|
Definition at line 71 of file Function.h. |