LLVM API Documentation

InlineFunction.cpp File Reference

#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
#include "llvm/Instructions.h"
#include "llvm/Intrinsics.h"
#include "llvm/Attributes.h"
#include "llvm/Analysis/CallGraph.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)
static void UpdateCallGraphAfterInlining (CallSite CS, Function::iterator FirstNewBlock, DenseMap< const Value *, Value * > &ValueMap, CallGraph &CG)
bool llvm::InlineFunction (CallSite CS, CallGraph *CG=0, const TargetData *TD=0)


Function Documentation

static void HandleInlinedInvoke ( InvokeInst II,
BasicBlock FirstNewBlock,
ClonedCodeInfo InlinedCodeInfo 
) [static]

HandleInlinedInvoke - If we inlined an invoke site, we need to convert calls in the body of the inlined function into invokes and turn unwind instructions into branches to the invoke unwind dest.

II is the invoke instruction begin inlined. FirstNewBlock is the first block of the inlined code (the last block is the end of the function), and InlineCodeInfo is information about the code that got inlined.

Definition at line 43 of file InlineFunction.cpp.

References llvm::PHINode::addIncoming(), BB, BBI, llvm::MachineBasicBlock::begin(), llvm::BasicBlock::begin(), Caller, CI, llvm::ClonedCodeInfo::ContainsCalls, llvm::ClonedCodeInfo::ContainsUnwinds, llvm::BranchInst::Create(), llvm::InvokeInst::Create(), llvm::CallInst::doesNotThrow(), E, llvm::MachineBasicBlock::end(), llvm::Function::end(), llvm::CallInst::getAttributes(), llvm::CallInst::getCalledValue(), llvm::CallInst::getCallingConv(), llvm::PHINode::getIncomingValueForBlock(), llvm::BasicBlock::getInstList(), llvm::Value::getName(), llvm::BasicBlock::getParent(), llvm::Instruction::getParent(), llvm::InvokeInst::getUnwindDest(), I, llvm::User::op_begin(), llvm::User::op_end(), llvm::MachineBasicBlock::pop_back(), llvm::BasicBlock::removePredecessor(), llvm::Value::replaceAllUsesWith(), and Split().

Referenced by llvm::InlineFunction().

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 147 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::BasicBlock::getParent(), llvm::Instruction::getParent(), I, and llvm::CallGraphNode::removeCallEdgeFor().

Referenced by llvm::InlineFunction().




This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.