LLVM API Documentation

llvm::Inliner Struct Reference

#include <InlinerPass.h>

Inheritance diagram for llvm::Inliner:
[legend]
Collaboration diagram for llvm::Inliner:
[legend]

List of all members.

Public Member Functions

 Inliner (void *ID)
 Inliner (void *ID, int Threshold)
virtual void getAnalysisUsage (AnalysisUsage &Info) const
virtual bool runOnSCC (const std::vector< CallGraphNode * > &SCC)
virtual bool doFinalization (CallGraph &CG)
unsigned getInlineThreshold () const
virtual InlineCost getInlineCost (CallSite CS)=0
virtual float getInlineFudgeFactor (CallSite CS)=0
virtual void resetCachedCostInfo (Function *Caller)=0
bool removeDeadFunctions (CallGraph &CG, SmallPtrSet< const Function *, 16 > *DNR=NULL)


Detailed Description

Inliner - This class contains all of the helper code which is used to perform the inlining operations that do not depend on the policy.

Definition at line 29 of file InlinerPass.h.


Constructor & Destructor Documentation

Inliner::Inliner ( void *  ID  )  [explicit]

Definition at line 37 of file Inliner.cpp.

Inliner::Inliner ( void *  ID,
int  Threshold 
) [explicit]

Definition at line 40 of file Inliner.cpp.


Member Function Documentation

void Inliner::getAnalysisUsage ( AnalysisUsage &  Info  )  const [virtual]

getAnalysisUsage - For this class, we declare that we require and preserve the call graph. If the derived class implements this method, it should always explicitly call the implementation here.

getAnalysisUsage - For this class, we declare that we require and preserve the call graph. If the derived class implements this method, it should always explicitly call the implementation here.

Reimplemented from llvm::CallGraphSCCPass.

Definition at line 46 of file Inliner.cpp.

References llvm::AnalysisUsage::addRequired(), and llvm::CallGraphSCCPass::getAnalysisUsage().

bool Inliner::runOnSCC ( const std::vector< CallGraphNode * > &  SCC  )  [virtual]

runOnSCC - This method should be implemented by the subclass to perform whatever action is necessary for the specified SCC. Note that non-recursive (or only self-recursive) functions will have an SCC size of 1, where recursive portions of the call graph will have SCC size > 1.

Implements llvm::CallGraphSCCPass.

Definition at line 124 of file Inliner.cpp.

References BB, llvm::MachineBasicBlock::begin(), Caller, Changed, DOUT, E, llvm::MachineBasicBlock::end(), F, llvm::CallSite::get(), llvm::CallSite::getCalledFunction(), llvm::CallSite::getCaller(), llvm::CallSite::getInstruction(), llvm::Value::getName(), InlineCallIfPossible(), llvm::Function::isDeclaration(), resetCachedCostInfo(), and std::swap().

bool Inliner::doFinalization ( CallGraph &  CG  )  [virtual]

doFinalization - This method is called after the SCC's of the program has been processed, allowing the pass to do final cleanup as necessary.

Reimplemented from llvm::CallGraphSCCPass.

Definition at line 221 of file Inliner.cpp.

References removeDeadFunctions().

unsigned llvm::Inliner::getInlineThreshold (  )  const [inline]

This method returns the value specified by the -inline-threshold value, specified on the command line. This is typically not directly needed.

Definition at line 50 of file InlinerPass.h.

virtual InlineCost llvm::Inliner::getInlineCost ( CallSite  CS  )  [pure virtual]

getInlineCost - This method must be implemented by the subclass to determine the cost of inlining the specified call site. If the cost returned is greater than the current inline threshold, the call site is not inlined.

virtual float llvm::Inliner::getInlineFudgeFactor ( CallSite  CS  )  [pure virtual]

virtual void llvm::Inliner::resetCachedCostInfo ( Function *  Caller  )  [pure virtual]

resetCachedCostInfo - erase any cached cost data from the derived class. If the derived class has no such data this can be empty.

Referenced by runOnSCC().

bool Inliner::removeDeadFunctions ( CallGraph &  CG,
SmallPtrSet< const Function *, 16 > *  DNR = NULL 
)


The documentation for this struct was generated from the following files: