mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
Remove a couple of #includes, move some code from .h file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4575 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
76351e9bab
commit
fc928245ad
@ -4,22 +4,15 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#include "llvm/Analysis/IPModRef.h"
|
||||||
#include "llvm/Analysis/DataStructure.h"
|
#include "llvm/Analysis/DataStructure.h"
|
||||||
#include "llvm/Analysis/DSGraph.h"
|
#include "llvm/Analysis/DSGraph.h"
|
||||||
#include "llvm/Analysis/IPModRef.h"
|
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/Function.h"
|
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/Pass.h"
|
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Statistic.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include "Support/StringExtras.h"
|
#include "Support/StringExtras.h"
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <utility>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// Private constants and data
|
// Private constants and data
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
@ -73,6 +66,12 @@ FunctionModRefInfo::~FunctionModRefInfo()
|
|||||||
callSiteModRefInfo.clear();
|
callSiteModRefInfo.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned FunctionModRefInfo::getNodeId(const Value* value) const {
|
||||||
|
return getNodeId(funcTDGraph.getNodeForValue(const_cast<Value*>(value))
|
||||||
|
.getNode());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Dummy function that will be replaced with one that inlines
|
// Dummy function that will be replaced with one that inlines
|
||||||
// the callee's BU graph into the caller's TD graph.
|
// the callee's BU graph into the caller's TD graph.
|
||||||
@ -199,6 +198,31 @@ bool IPModRef::run(Module &theModule)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FunctionModRefInfo& IPModRef::getFuncInfo(const Function& func,
|
||||||
|
bool computeIfMissing)
|
||||||
|
{
|
||||||
|
FunctionModRefInfo*& funcInfo = funcToModRefInfoMap[&func];
|
||||||
|
assert (funcInfo != NULL || computeIfMissing);
|
||||||
|
if (funcInfo == NULL && computeIfMissing)
|
||||||
|
{ // Create a new FunctionModRefInfo object
|
||||||
|
funcInfo = new FunctionModRefInfo(func, // inserts into map
|
||||||
|
getAnalysis<TDDataStructures>().getDSGraph(func),
|
||||||
|
getAnalysis<LocalDataStructures>().getDSGraph(func));
|
||||||
|
funcInfo->computeModRef(func); // computes the mod/ref info
|
||||||
|
}
|
||||||
|
return *funcInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
// getAnalysisUsage - This pass requires top-down data structure graphs.
|
||||||
|
// It modifies nothing.
|
||||||
|
//
|
||||||
|
void IPModRef::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||||
|
AU.setPreservesAll();
|
||||||
|
AU.addRequired<LocalDataStructures>();
|
||||||
|
AU.addRequired<TDDataStructures>();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void IPModRef::print(std::ostream &O) const
|
void IPModRef::print(std::ostream &O) const
|
||||||
{
|
{
|
||||||
O << "\n========== Results of Interprocedural Mod/Ref Analysis ==========\n";
|
O << "\n========== Results of Interprocedural Mod/Ref Analysis ==========\n";
|
||||||
|
@ -4,22 +4,15 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#include "llvm/Analysis/IPModRef.h"
|
||||||
#include "llvm/Analysis/DataStructure.h"
|
#include "llvm/Analysis/DataStructure.h"
|
||||||
#include "llvm/Analysis/DSGraph.h"
|
#include "llvm/Analysis/DSGraph.h"
|
||||||
#include "llvm/Analysis/IPModRef.h"
|
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/Function.h"
|
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/Pass.h"
|
|
||||||
#include "Support/Statistic.h"
|
#include "Support/Statistic.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include "Support/StringExtras.h"
|
#include "Support/StringExtras.h"
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <utility>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// Private constants and data
|
// Private constants and data
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
@ -73,6 +66,12 @@ FunctionModRefInfo::~FunctionModRefInfo()
|
|||||||
callSiteModRefInfo.clear();
|
callSiteModRefInfo.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned FunctionModRefInfo::getNodeId(const Value* value) const {
|
||||||
|
return getNodeId(funcTDGraph.getNodeForValue(const_cast<Value*>(value))
|
||||||
|
.getNode());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Dummy function that will be replaced with one that inlines
|
// Dummy function that will be replaced with one that inlines
|
||||||
// the callee's BU graph into the caller's TD graph.
|
// the callee's BU graph into the caller's TD graph.
|
||||||
@ -199,6 +198,31 @@ bool IPModRef::run(Module &theModule)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FunctionModRefInfo& IPModRef::getFuncInfo(const Function& func,
|
||||||
|
bool computeIfMissing)
|
||||||
|
{
|
||||||
|
FunctionModRefInfo*& funcInfo = funcToModRefInfoMap[&func];
|
||||||
|
assert (funcInfo != NULL || computeIfMissing);
|
||||||
|
if (funcInfo == NULL && computeIfMissing)
|
||||||
|
{ // Create a new FunctionModRefInfo object
|
||||||
|
funcInfo = new FunctionModRefInfo(func, // inserts into map
|
||||||
|
getAnalysis<TDDataStructures>().getDSGraph(func),
|
||||||
|
getAnalysis<LocalDataStructures>().getDSGraph(func));
|
||||||
|
funcInfo->computeModRef(func); // computes the mod/ref info
|
||||||
|
}
|
||||||
|
return *funcInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
// getAnalysisUsage - This pass requires top-down data structure graphs.
|
||||||
|
// It modifies nothing.
|
||||||
|
//
|
||||||
|
void IPModRef::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||||
|
AU.setPreservesAll();
|
||||||
|
AU.addRequired<LocalDataStructures>();
|
||||||
|
AU.addRequired<TDDataStructures>();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void IPModRef::print(std::ostream &O) const
|
void IPModRef::print(std::ostream &O) const
|
||||||
{
|
{
|
||||||
O << "\n========== Results of Interprocedural Mod/Ref Analysis ==========\n";
|
O << "\n========== Results of Interprocedural Mod/Ref Analysis ==========\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user