LLVM API Documentation

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

FunctionResolution.cpp File Reference

#include "llvm/Transforms/IPO.h"
#include "llvm/Module.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Pass.h"
#include "llvm/Instructions.h"
#include "llvm/Constants.h"
#include "llvm/Support/CallSite.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/ADT/Statistic.h"
#include <algorithm>

Include dependency graph for FunctionResolution.cpp:

Go to the source code of this file.

Functions

ModulePassllvm::createFunctionResolvingPass ()
static bool ResolveFunctions (Module &M, std::vector< GlobalValue * > &Globals, Function *Concrete)
static bool ResolveGlobalVariables (Module &M, std::vector< GlobalValue * > &Globals, GlobalVariable *Concrete)
static bool CallersAllIgnoreReturnValue (Function &F)
static bool ProcessGlobalsWithSameName (Module &M, TargetData &TD, std::vector< GlobalValue * > &Globals)


Function Documentation

static bool CallersAllIgnoreReturnValue Function F  )  [static]
 

Definition at line 136 of file FunctionResolution.cpp.

References E, llvm::CallSite::getInstruction(), llvm::Function::getReturnType(), I, llvm::Value::use_begin(), llvm::Value::use_empty(), and llvm::Value::use_end().

Referenced by ProcessGlobalsWithSameName().

static bool ProcessGlobalsWithSameName Module M,
TargetData TD,
std::vector< GlobalValue * > &  Globals
[static]
 

Definition at line 155 of file FunctionResolution.cpp.

References CallersAllIgnoreReturnValue(), F, llvm::SequentialType::getElementType(), llvm::Function::getFunctionType(), llvm::Value::getName(), llvm::FunctionType::getNumParams(), llvm::GlobalValue::getType(), llvm::TargetData::getTypeSize(), llvm::GlobalVariable::isExternal(), llvm::GlobalValue::isExternal(), llvm::Function::isExternal(), llvm::Type::isSized(), llvm::MVT::Other, ResolveFunctions(), ResolveGlobalVariables(), llvm::GlobalVariable::setInitializer(), and llvm::WriteTypeSymbolic().

static bool ResolveFunctions Module M,
std::vector< GlobalValue * > &  Globals,
Function Concrete
[static]
 

Definition at line 52 of file FunctionResolution.cpp.

References llvm::Module::getFunctionList(), llvm::Function::getFunctionType(), llvm::Value::getName(), llvm::FunctionType::getNumParams(), llvm::FunctionType::getParamType(), llvm::GlobalValue::getType(), llvm::Type::getTypeID(), llvm::FunctionType::isVarArg(), NumResolved, llvm::Value::replaceAllUsesWith(), llvm::Value::use_empty(), llvm::Value::use_size(), llvm::WriteAsOperand(), and llvm::WriteTypeSymbolic().

Referenced by ProcessGlobalsWithSameName().

static bool ResolveGlobalVariables Module M,
std::vector< GlobalValue * > &  Globals,
GlobalVariable Concrete
[static]
 

Definition at line 116 of file FunctionResolution.cpp.

References llvm::Module::getGlobalList(), and NumGlobals.

Referenced by ProcessGlobalsWithSameName().


Variable Documentation

Statistic NumGlobals("funcresolve","Number of global variables resolved") [static]
 

Statistic NumResolved("funcresolve","Number of varargs functions resolved") [static]
 

Referenced by ResolveFunctions().

RegisterOpt<FunctionResolvingPass> X("funcresolve","Resolve Functions") [static]