LLVM API Documentation

InlineFunction.cpp File Reference

#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
#include "llvm/Instructions.h"
#include "llvm/IntrinsicInst.h"
#include "llvm/Intrinsics.h"
#include "llvm/Attributes.h"
#include "llvm/Analysis/CallGraph.h"
#include "llvm/Analysis/DebugInfo.h"
#include "llvm/Target/TargetData.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/CallSite.h"

Include dependency graph for InlineFunction.cpp:

Go to the source code of this file.

Functions

bool llvm::InlineFunction (CallInst *C, CallGraph *CG=0, const TargetData *TD=0)
bool llvm::InlineFunction (InvokeInst *II, CallGraph *CG=0, const TargetData *TD=0)
static void HandleInlinedInvoke (InvokeInst *II, BasicBlock *FirstNewBlock, ClonedCodeInfo &InlinedCodeInfo, CallGraph *CG)
static void UpdateCallGraphAfterInlining (CallSite CS, Function::iterator FirstNewBlock, DenseMap< const Value *, Value * > &ValueMap, CallGraph &CG)
static const DbgRegionEndInst * findFnRegionEndMarker (const Function *F)
bool llvm::InlineFunction (CallSite CS, CallGraph *CG=0, const TargetData *TD=0)


Function Documentation

static const DbgRegionEndInst* findFnRegionEndMarker ( const Function *  F  )  [static]

findFnRegionEndMarker - This is a utility routine that is used by InlineFunction. Return llvm.dbg.region.end intrinsic that corresponds to the llvm.dbg.func.start of the function F. Otherwise return NULL.

Definition at line 208 of file InlineFunction.cpp.

References llvm::GCFunctionInfo::begin(), llvm::Function::begin(), llvm::DISubprogram::describes(), llvm::Function::end(), llvm::GCFunctionInfo::end(), FI, llvm::DIDescriptor::getGV(), and llvm::DIDescriptor::isNull().

Referenced by llvm::InlineFunction().

static void HandleInlinedInvoke ( InvokeInst *  II,
BasicBlock *  FirstNewBlock,
ClonedCodeInfo &  InlinedCodeInfo,
CallGraph *  CG 
) [static]

static void UpdateCallGraphAfterInlining ( CallSite  CS,
Function::iterator  FirstNewBlock,
DenseMap< const Value *, Value * > &  ValueMap,
CallGraph &  CG 
) [static]

UpdateCallGraphAfterInlining - Once we have cloned code over from a callee into the caller, update the specified callgraph to reflect the changes we made. Note that it's possible that not all code was copied over, so only some edges of the callgraph may remain.

Definition at line 167 of file InlineFunction.cpp.

References llvm::CallGraphNode::addCalledFunction(), llvm::CallGraphNode::begin(), Caller, E, llvm::DenseMap< KeyT, ValueT, KeyInfoT, ValueInfoT >::end(), llvm::CallGraphNode::end(), llvm::DenseMap< KeyT, ValueT, KeyInfoT, ValueInfoT >::find(), llvm::CallSite::get(), llvm::CallSite::getCalledFunction(), llvm::CallSite::getInstruction(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), and llvm::CallGraphNode::removeCallEdgeFor().

Referenced by llvm::InlineFunction().