mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
change refs to Method to Function
Change references to MEthodArgument to FunctionArgument llvm-svn: 1989
This commit is contained in:
parent
fecabeab3c
commit
57efd6ffd1
@ -9,7 +9,7 @@
|
||||
|
||||
#include "llvm/Analysis/Expressions.h"
|
||||
#include "llvm/Transforms/Scalar/ConstantHandling.h"
|
||||
#include "llvm/Method.h"
|
||||
#include "llvm/Function.h"
|
||||
#include "llvm/BasicBlock.h"
|
||||
#include <iostream>
|
||||
|
||||
@ -240,12 +240,12 @@ ExprType analysis::ClassifyExpression(Value *Expr) {
|
||||
switch (Expr->getValueType()) {
|
||||
case Value::InstructionVal: break; // Instruction... hmmm... investigate.
|
||||
case Value::TypeVal: case Value::BasicBlockVal:
|
||||
case Value::MethodVal: case Value::ModuleVal: default:
|
||||
case Value::FunctionVal: case Value::ModuleVal: default:
|
||||
//assert(0 && "Unexpected expression type to classify!");
|
||||
std::cerr << "Bizarre thing to expr classify: " << Expr << "\n";
|
||||
return Expr;
|
||||
case Value::GlobalVariableVal: // Global Variable & Method argument:
|
||||
case Value::MethodArgumentVal: // nothing known, return variable itself
|
||||
case Value::GlobalVariableVal: // Global Variable & Function argument:
|
||||
case Value::FunctionArgumentVal: // nothing known, return variable itself
|
||||
return Expr;
|
||||
case Value::ConstantVal: // Constant value, just return constant
|
||||
Constant *CPV = cast<Constant>(Expr);
|
||||
|
@ -40,7 +40,7 @@
|
||||
|
||||
#include "llvm/Analysis/CallGraph.h"
|
||||
#include "llvm/Module.h"
|
||||
#include "llvm/Method.h"
|
||||
#include "llvm/Function.h"
|
||||
#include "llvm/iOther.h"
|
||||
#include "llvm/iTerminators.h"
|
||||
#include "Support/STLExtras.h"
|
||||
@ -52,18 +52,18 @@ AnalysisID CallGraph::ID(AnalysisID::create<CallGraph>());
|
||||
// getNodeFor - Return the node for the specified method or create one if it
|
||||
// does not already exist.
|
||||
//
|
||||
CallGraphNode *CallGraph::getNodeFor(Method *M) {
|
||||
CallGraphNode *&CGN = MethodMap[M];
|
||||
CallGraphNode *CallGraph::getNodeFor(Function *F) {
|
||||
CallGraphNode *&CGN = MethodMap[F];
|
||||
if (CGN) return CGN;
|
||||
|
||||
assert((!M || M->getParent() == Mod) && "Method not in current module!");
|
||||
return CGN = new CallGraphNode(M);
|
||||
assert((!F || F->getParent() == Mod) && "Function not in current module!");
|
||||
return CGN = new CallGraphNode(F);
|
||||
}
|
||||
|
||||
// addToCallGraph - Add a method to the call graph, and link the node to all of
|
||||
// the methods that it calls.
|
||||
//
|
||||
void CallGraph::addToCallGraph(Method *M) {
|
||||
void CallGraph::addToCallGraph(Function *M) {
|
||||
CallGraphNode *Node = getNodeFor(M);
|
||||
|
||||
// If this method has external linkage,
|
||||
@ -94,7 +94,7 @@ void CallGraph::addToCallGraph(Method *M) {
|
||||
}
|
||||
|
||||
// Look for an indirect method call...
|
||||
for (Method::iterator BBI = M->begin(), BBE = M->end(); BBI != BBE; ++BBI) {
|
||||
for (Function::iterator BBI = M->begin(), BBE = M->end(); BBI != BBE; ++BBI) {
|
||||
BasicBlock *BB = *BBI;
|
||||
for (BasicBlock::iterator II = BB->begin(), IE = BB->end(); II != IE; ++II){
|
||||
Instruction *I = *II;
|
||||
@ -161,7 +161,7 @@ void WriteToOutput(const CallGraph &CG, std::ostream &o) {
|
||||
// Methods to keep a call graph up to date with a method that has been
|
||||
// modified
|
||||
//
|
||||
void CallGraph::addMethodToModule(Method *Meth) {
|
||||
void CallGraph::addMethodToModule(Function *Meth) {
|
||||
assert(0 && "not implemented");
|
||||
abort();
|
||||
}
|
||||
@ -172,14 +172,14 @@ void CallGraph::addMethodToModule(Method *Meth) {
|
||||
// methods (ie, there are no edges in it's CGN). The easiest way to do this
|
||||
// is to dropAllReferences before calling this.
|
||||
//
|
||||
Method *CallGraph::removeMethodFromModule(CallGraphNode *CGN) {
|
||||
Function *CallGraph::removeMethodFromModule(CallGraphNode *CGN) {
|
||||
assert(CGN->CalledMethods.empty() && "Cannot remove method from call graph"
|
||||
" if it references other methods!");
|
||||
Method *M = CGN->getMethod(); // Get the method for the call graph node
|
||||
delete CGN; // Delete the call graph node for this method
|
||||
Function *M = CGN->getMethod(); // Get the function for the call graph node
|
||||
delete CGN; // Delete the call graph node for this func
|
||||
MethodMap.erase(M); // Remove the call graph node from the map
|
||||
|
||||
Mod->getMethodList().remove(M);
|
||||
Mod->getFunctionList().remove(M);
|
||||
return M;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ using analysis::ExprType;
|
||||
|
||||
|
||||
static bool isLoopInvariant(const Value *V, const cfg::Loop *L) {
|
||||
if (isa<Constant>(V) || isa<MethodArgument>(V) || isa<GlobalValue>(V))
|
||||
if (isa<Constant>(V) || isa<FunctionArgument>(V) || isa<GlobalValue>(V))
|
||||
return true;
|
||||
|
||||
const Instruction *I = cast<Instruction>(V);
|
||||
|
Loading…
Reference in New Issue
Block a user