LLVM API Documentation

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 <iostream>

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)

Variables

Statistic NumResolved ("funcresolve","Number of varargs functions resolved")
Statistic NumGlobals ("funcresolve","Number of global variables resolved")
RegisterOpt< FunctionResolvingPass > X ("funcresolve","Resolve Functions")


Function Documentation

static bool CallersAllIgnoreReturnValue ( Function F  )  [static]

Definition at line 139 of file FunctionResolution.cpp.

References E, F, llvm::CallSite::getInstruction(), GV, 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 158 of file FunctionResolution.cpp.

References CallersAllIgnoreReturnValue(), F, llvm::SequentialType::getElementType(), llvm::Value::getName(), llvm::GlobalValue::getType(), llvm::TargetData::getTypeSize(), GV, llvm::GlobalValue::isExternal(), llvm::GlobalValue::isNullValue(), llvm::Type::isSized(), M, llvm::MVT::Other, ResolveFunctions(), ResolveGlobalVariables(), llvm::GlobalVariable::setInitializer(), TD, llvm::Value::use_empty(), and llvm::WriteTypeSymbolic().

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

Definition at line 53 of file FunctionResolution.cpp.

References Changed, llvm::Module::getFunctionList(), llvm::Function::getFunctionType(), llvm::Module::getModuleIdentifier(), llvm::Value::getName(), llvm::FunctionType::getNumParams(), llvm::Value::getNumUses(), llvm::FunctionType::getParamType(), llvm::GlobalValue::getParent(), llvm::GlobalValue::getType(), llvm::Type::getTypeID(), llvm::FunctionType::isVarArg(), M, NumResolved, llvm::Value::replaceAllUsesWith(), Replacement, llvm::Value::use_empty(), llvm::WriteAsOperand(), and llvm::WriteTypeSymbolic().

Referenced by ProcessGlobalsWithSameName().

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

Definition at line 119 of file FunctionResolution.cpp.

References Changed, llvm::Module::getGlobalList(), M, 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]