aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-03-26 18:01:55 +0000
committerChris Lattner <sabre@nondot.org>2002-03-26 18:01:55 +0000
commit79df7c0aaa18129e55968c8783ef8346807bd4af (patch)
tree4269fd8c25425d5164ee295b9060838df090d03f /lib/VMCore
parentb0d04726db108a8e8c43939d6321924a37199e24 (diff)
Change references from Method to Function
change references from MethodARgument to FunctionArgument git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1991 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/AsmWriter.cpp56
-rw-r--r--lib/VMCore/Function.cpp16
-rw-r--r--lib/VMCore/InstrTypes.cpp8
-rw-r--r--lib/VMCore/Linker.cpp84
-rw-r--r--lib/VMCore/Module.cpp18
-rw-r--r--lib/VMCore/Pass.cpp22
-rw-r--r--lib/VMCore/SymbolTable.cpp8
7 files changed, 106 insertions, 106 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index c218c0fcd0..a7b6db42db 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -13,7 +13,7 @@
#include "llvm/Assembly/CachedWriter.h"
#include "llvm/Analysis/SlotCalculator.h"
#include "llvm/Module.h"
-#include "llvm/Method.h"
+#include "llvm/Function.h"
#include "llvm/GlobalVariable.h"
#include "llvm/BasicBlock.h"
#include "llvm/ConstantVals.h"
@@ -32,14 +32,14 @@ using std::vector;
using std::ostream;
static const Module *getModuleFromVal(const Value *V) {
- if (const MethodArgument *MA =dyn_cast<const MethodArgument>(V))
+ if (const FunctionArgument *MA = dyn_cast<const FunctionArgument>(V))
return MA->getParent() ? MA->getParent()->getParent() : 0;
else if (const BasicBlock *BB = dyn_cast<const BasicBlock>(V))
return BB->getParent() ? BB->getParent()->getParent() : 0;
else if (const Instruction *I = dyn_cast<const Instruction>(V)) {
- const Method *M = I->getParent() ? I->getParent()->getParent() : 0;
+ const Function *M = I->getParent() ? I->getParent()->getParent() : 0;
return M ? M->getParent() : 0;
- } else if (const GlobalValue *GV =dyn_cast<const GlobalValue>(V))
+ } else if (const GlobalValue *GV = dyn_cast<const GlobalValue>(V))
return GV->getParent();
else if (const Module *Mod = dyn_cast<const Module>(V))
return Mod;
@@ -48,16 +48,16 @@ static const Module *getModuleFromVal(const Value *V) {
static SlotCalculator *createSlotCalculator(const Value *V) {
assert(!isa<Type>(V) && "Can't create an SC for a type!");
- if (const MethodArgument *MA =dyn_cast<const MethodArgument>(V)){
- return new SlotCalculator(MA->getParent(), true);
+ if (const FunctionArgument *FA = dyn_cast<const FunctionArgument>(V)) {
+ return new SlotCalculator(FA->getParent(), true);
} else if (const Instruction *I = dyn_cast<const Instruction>(V)) {
return new SlotCalculator(I->getParent()->getParent(), true);
} else if (const BasicBlock *BB = dyn_cast<const BasicBlock>(V)) {
return new SlotCalculator(BB->getParent(), true);
- } else if (const GlobalVariable *GV =dyn_cast<const GlobalVariable>(V)){
+ } else if (const GlobalVariable *GV = dyn_cast<const GlobalVariable>(V)){
return new SlotCalculator(GV->getParent(), true);
- } else if (const Method *Meth = dyn_cast<const Method>(V)) {
- return new SlotCalculator(Meth, true);
+ } else if (const Function *Func = dyn_cast<const Function>(V)) {
+ return new SlotCalculator(Func, true);
} else if (const Module *Mod = dyn_cast<const Module>(V)) {
return new SlotCalculator(Mod, true);
}
@@ -276,7 +276,7 @@ public:
inline void write(const Module *M) { printModule(M); }
inline void write(const GlobalVariable *G) { printGlobal(G); }
- inline void write(const Method *M) { printMethod(M); }
+ inline void write(const Function *F) { printFunction(F); }
inline void write(const BasicBlock *BB) { printBasicBlock(BB); }
inline void write(const Instruction *I) { printInstruction(I); }
inline void write(const Constant *CPV) { printConstant(CPV); }
@@ -287,8 +287,8 @@ private :
void printSymbolTable(const SymbolTable &ST);
void printConstant(const Constant *CPV);
void printGlobal(const GlobalVariable *GV);
- void printMethod(const Method *M);
- void printMethodArgument(const MethodArgument *MA);
+ void printFunction(const Function *F);
+ void printFunctionArgument(const FunctionArgument *FA);
void printBasicBlock(const BasicBlock *BB);
void printInstruction(const Instruction *I);
ostream &printType(const Type *Ty);
@@ -319,7 +319,7 @@ void AssemblyWriter::printModule(const Module *M) {
Out << "implementation\n";
// Output all of the methods...
- for_each(M->begin(), M->end(), bind_obj(this,&AssemblyWriter::printMethod));
+ for_each(M->begin(), M->end(), bind_obj(this,&AssemblyWriter::printFunction));
}
void AssemblyWriter::printGlobal(const GlobalVariable *GV) {
@@ -385,9 +385,9 @@ void AssemblyWriter::printConstant(const Constant *CPV) {
Out << "\n";
}
-// printMethod - Print all aspects of a method.
+// printFunction - Print all aspects of a method.
//
-void AssemblyWriter::printMethod(const Method *M) {
+void AssemblyWriter::printFunction(const Function *M) {
// Print out the return type and name...
Out << "\n" << (M->isExternal() ? "declare " : "")
<< (M->hasInternalLinkage() ? "internal " : "");
@@ -399,7 +399,7 @@ void AssemblyWriter::printMethod(const Method *M) {
if (!M->isExternal()) {
for_each(M->getArgumentList().begin(), M->getArgumentList().end(),
- bind_obj(this, &AssemblyWriter::printMethodArgument));
+ bind_obj(this, &AssemblyWriter::printFunctionArgument));
} else {
// Loop over the arguments, printing them...
const MethodType *MT = cast<const MethodType>(M->getMethodType());
@@ -434,10 +434,10 @@ void AssemblyWriter::printMethod(const Method *M) {
Table.purgeMethod();
}
-// printMethodArgument - This member is called for every argument that
+// printFunctionArgument - This member is called for every argument that
// is passed into the method. Simply print it out
//
-void AssemblyWriter::printMethodArgument(const MethodArgument *Arg) {
+void AssemblyWriter::printFunctionArgument(const FunctionArgument *Arg) {
// Insert commas as we go... the first arg doesn't get a comma
if (Arg != Arg->getParent()->getArgumentList().front()) Out << ", ";
@@ -651,12 +651,12 @@ void WriteToAssembly(const GlobalVariable *G, ostream &o) {
W.write(G);
}
-void WriteToAssembly(const Method *M, ostream &o) {
- if (M == 0) { o << "<null> method\n"; return; }
- SlotCalculator SlotTable(M->getParent(), true);
- AssemblyWriter W(o, SlotTable, M->getParent());
+void WriteToAssembly(const Function *F, ostream &o) {
+ if (F == 0) { o << "<null> function\n"; return; }
+ SlotCalculator SlotTable(F->getParent(), true);
+ AssemblyWriter W(o, SlotTable, F->getParent());
- W.write(M);
+ W.write(F);
}
@@ -678,9 +678,9 @@ void WriteToAssembly(const Constant *CPV, ostream &o) {
void WriteToAssembly(const Instruction *I, ostream &o) {
if (I == 0) { o << "<null> instruction\n"; return; }
- const Method *M = I->getParent() ? I->getParent()->getParent() : 0;
- SlotCalculator SlotTable(M, true);
- AssemblyWriter W(o, SlotTable, M ? M->getParent() : 0);
+ const Function *F = I->getParent() ? I->getParent()->getParent() : 0;
+ SlotCalculator SlotTable(F, true);
+ AssemblyWriter W(o, SlotTable, F ? F->getParent() : 0);
W.write(I);
}
@@ -706,12 +706,12 @@ CachedWriter &CachedWriter::operator<<(const Value *V) {
case Value::ConstantVal:
Out << " "; AW->write(V->getType());
Out << " " << cast<Constant>(V)->getStrValue(); break;
- case Value::MethodArgumentVal:
+ case Value::FunctionArgumentVal:
AW->write(V->getType()); Out << " " << V->getName(); break;
case Value::TypeVal: AW->write(cast<const Type>(V)); break;
case Value::InstructionVal: AW->write(cast<Instruction>(V)); break;
case Value::BasicBlockVal: AW->write(cast<BasicBlock>(V)); break;
- case Value::MethodVal: AW->write(cast<Method>(V)); break;
+ case Value::FunctionVal: AW->write(cast<Function>(V)); break;
case Value::GlobalVariableVal: AW->write(cast<GlobalVariable>(V)); break;
case Value::ModuleVal: AW->write(cast<Module>(V)); break;
default: Out << "<unknown value type: " << V->getValueType() << ">"; break;
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index 286ef7fbe1..1ff87aabd9 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -1,6 +1,6 @@
-//===-- Method.cpp - Implement the Method class ------------------*- C++ -*--=//
+//===-- Function.cpp - Implement the Global object classes -------*- C++ -*--=//
//
-// This file implements the Method & GlobalVariable classes for the VMCore
+// This file implements the Function & GlobalVariable classes for the VMCore
// library.
//
//===----------------------------------------------------------------------===//
@@ -9,27 +9,27 @@
#include "llvm/DerivedTypes.h"
#include "llvm/SymbolTable.h"
#include "llvm/Module.h"
-#include "llvm/Method.h"
+#include "llvm/Function.h"
#include "llvm/GlobalVariable.h"
#include "llvm/BasicBlock.h"
#include "llvm/iOther.h"
//===----------------------------------------------------------------------===//
-// Method Implementation
+// Function Implementation
//===----------------------------------------------------------------------===//
// Instantiate Templates - This ugliness is the price we have to pay
// for having a ValueHolderImpl.h file seperate from ValueHolder.h! :(
//
-template class ValueHolder<MethodArgument, Method, Method>;
-template class ValueHolder<BasicBlock , Method, Method>;
+template class ValueHolder<FunctionArgument, Function, Function>;
+template class ValueHolder<BasicBlock , Function, Function>;
Function::Function(const MethodType *Ty, bool isInternal,
const std::string &name)
- : GlobalValue(PointerType::get(Ty), Value::MethodVal, isInternal, name),
+ : GlobalValue(PointerType::get(Ty), Value::FunctionVal, isInternal, name),
SymTabValue(this), BasicBlocks(this), ArgumentList(this, this) {
- assert(::isa<MethodType>(Ty) && "Method signature must be of method type!");
+ assert(::isa<MethodType>(Ty) && "Function signature must be of method type!");
}
Function::~Function() {
diff --git a/lib/VMCore/InstrTypes.cpp b/lib/VMCore/InstrTypes.cpp
index 3ed9e688ee..f42d633dbb 100644
--- a/lib/VMCore/InstrTypes.cpp
+++ b/lib/VMCore/InstrTypes.cpp
@@ -7,7 +7,7 @@
#include "llvm/iOther.h"
#include "llvm/iPHINode.h"
#include "llvm/BasicBlock.h"
-#include "llvm/Method.h"
+#include "llvm/Function.h"
#include "llvm/SymbolTable.h"
#include "llvm/Type.h"
#include <algorithm> // find
@@ -27,12 +27,12 @@ TerminatorInst::TerminatorInst(const Type *Ty, Instruction::TermOps iType,
//===----------------------------------------------------------------------===//
-// MethodArgument Class
+// FunctionArgument Class
//===----------------------------------------------------------------------===//
// Specialize setName to take care of symbol table majik
-void MethodArgument::setName(const std::string &name, SymbolTable *ST) {
- Method *P;
+void FunctionArgument::setName(const std::string &name, SymbolTable *ST) {
+ Function *P;
assert((ST == 0 || (!getParent() || ST == getParent()->getSymbolTable())) &&
"Invalid symtab argument!");
if ((P = getParent()) && hasName()) P->getSymbolTable()->remove(this);
diff --git a/lib/VMCore/Linker.cpp b/lib/VMCore/Linker.cpp
index c98295cc66..f3b0084dfc 100644
--- a/lib/VMCore/Linker.cpp
+++ b/lib/VMCore/Linker.cpp
@@ -11,7 +11,7 @@
#include "llvm/Transforms/Linker.h"
#include "llvm/Module.h"
-#include "llvm/Method.h"
+#include "llvm/Function.h"
#include "llvm/BasicBlock.h"
#include "llvm/GlobalVariable.h"
#include "llvm/SymbolTable.h"
@@ -165,8 +165,8 @@ static bool LinkGlobals(Module *Dest, const Module *Src,
(V = ST->lookup(SGV->getType(), SGV->getName())) &&
cast<GlobalVariable>(V)->hasExternalLinkage()) {
// The same named thing is a global variable, because the only two things
- // that may be in a module level symbol table are Global Vars and Methods,
- // and they both have distinct, nonoverlapping, possible types.
+ // that may be in a module level symbol table are Global Vars and
+ // Functions, and they both have distinct, nonoverlapping, possible types.
//
GlobalVariable *DGV = cast<GlobalVariable>(V);
@@ -231,13 +231,13 @@ static bool LinkGlobalInits(Module *Dest, const Module *Src,
return false;
}
-// LinkMethodProtos - Link the methods together between the two modules, without
-// doing method bodies... this just adds external method prototypes to the Dest
-// method...
+// LinkFunctionProtos - Link the functions together between the two modules,
+// without doing method bodies... this just adds external method prototypes to
+// the Dest function...
//
-static bool LinkMethodProtos(Module *Dest, const Module *Src,
- map<const Value*, Value*> &ValueMap,
- string *Err = 0) {
+static bool LinkFunctionProtos(Module *Dest, const Module *Src,
+ map<const Value*, Value*> &ValueMap,
+ string *Err = 0) {
// We will need a module level symbol table if the src module has a module
// level symbol table...
SymbolTable *ST = Src->getSymbolTable() ? Dest->getSymbolTableSure() : 0;
@@ -245,7 +245,7 @@ static bool LinkMethodProtos(Module *Dest, const Module *Src,
// Loop over all of the methods in the src module, mapping them over as we go
//
for (Module::const_iterator I = Src->begin(), E = Src->end(); I != E; ++I) {
- const Method *SM = *I; // SrcMethod
+ const Function *SM = *I; // SrcFunction
Value *V;
// If the method has a name, and that name is already in use in the
@@ -253,29 +253,29 @@ static bool LinkMethodProtos(Module *Dest, const Module *Src,
//
if (SM->hasExternalLinkage() && SM->hasName() &&
(V = ST->lookup(SM->getType(), SM->getName())) &&
- cast<Method>(V)->hasExternalLinkage()) {
- // The same named thing is a Method, because the only two things
- // that may be in a module level symbol table are Global Vars and Methods,
- // and they both have distinct, nonoverlapping, possible types.
+ cast<Function>(V)->hasExternalLinkage()) {
+ // The same named thing is a Function, because the only two things
+ // that may be in a module level symbol table are Global Vars and
+ // Functions, and they both have distinct, nonoverlapping, possible types.
//
- Method *DM = cast<Method>(V); // DestMethod
+ Function *DM = cast<Function>(V); // DestFunction
// Check to make sure the method is not defined in both modules...
if (!SM->isExternal() && !DM->isExternal())
- return Error(Err, "Method '" +
+ return Error(Err, "Function '" +
SM->getMethodType()->getDescription() + "':\"" +
- SM->getName() + "\" - Method is already defined!");
+ SM->getName() + "\" - Function is already defined!");
// Otherwise, just remember this mapping...
ValueMap.insert(std::make_pair(SM, DM));
} else {
- // Method does not already exist, simply insert an external method
+ // Function does not already exist, simply insert an external method
// signature identical to SM into the dest module...
- Method *DM = new Method(SM->getMethodType(), SM->hasInternalLinkage(),
- SM->getName());
+ Function *DM = new Function(SM->getMethodType(), SM->hasInternalLinkage(),
+ SM->getName());
// Add the method signature to the dest module...
- Dest->getMethodList().push_back(DM);
+ Dest->getFunctionList().push_back(DM);
// ... and remember this mapping...
ValueMap.insert(std::make_pair(SM, DM));
@@ -284,24 +284,24 @@ static bool LinkMethodProtos(Module *Dest, const Module *Src,
return false;
}
-// LinkMethodBody - Copy the source method over into the dest method and fix up
-// references to values. At this point we know that Dest is an external method,
-// and that Src is not.
+// LinkFunctionBody - Copy the source method over into the dest method
+// and fix up references to values. At this point we know that Dest
+// is an external method, and that Src is not.
//
-static bool LinkMethodBody(Method *Dest, const Method *Src,
- const map<const Value*, Value*> &GlobalMap,
- string *Err = 0) {
+static bool LinkFunctionBody(Function *Dest, const Function *Src,
+ const map<const Value*, Value*> &GlobalMap,
+ string *Err = 0) {
assert(Src && Dest && Dest->isExternal() && !Src->isExternal());
map<const Value*, Value*> LocalMap; // Map for method local values
// Go through and convert method arguments over...
- for (Method::ArgumentListType::const_iterator
+ for (Function::ArgumentListType::const_iterator
I = Src->getArgumentList().begin(),
E = Src->getArgumentList().end(); I != E; ++I) {
- const MethodArgument *SMA = *I;
+ const FunctionArgument *SMA = *I;
// Create the new method argument and add to the dest method...
- MethodArgument *DMA = new MethodArgument(SMA->getType(), SMA->getName());
+ FunctionArgument *DMA = new FunctionArgument(SMA->getType(),SMA->getName());
Dest->getArgumentList().push_back(DMA);
// Add a mapping to our local map
@@ -310,7 +310,7 @@ static bool LinkMethodBody(Method *Dest, const Method *Src,
// Loop over all of the basic blocks, copying the instructions over...
//
- for (Method::const_iterator I = Src->begin(), E = Src->end(); I != E; ++I) {
+ for (Function::const_iterator I = Src->begin(), E = Src->end(); I != E; ++I) {
const BasicBlock *SBB = *I;
// Create new basic block and add to mapping and the Dest method...
@@ -338,7 +338,7 @@ static bool LinkMethodBody(Method *Dest, const Method *Src,
// in the Source method as operands. Loop through all of the operands of the
// methods and patch them up to point to the local versions...
//
- for (Method::iterator BI = Dest->begin(), BE = Dest->end();
+ for (Function::iterator BI = Dest->begin(), BE = Dest->end();
BI != BE; ++BI) {
BasicBlock *BB = *BI;
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
@@ -354,30 +354,30 @@ static bool LinkMethodBody(Method *Dest, const Method *Src,
}
-// LinkMethodBodies - Link in the method bodies that are defined in the source
+// LinkFunctionBodies - Link in the method bodies that are defined in the source
// module into the DestModule. This consists basically of copying the method
// over and fixing up references to values.
//
-static bool LinkMethodBodies(Module *Dest, const Module *Src,
- map<const Value*, Value*> &ValueMap,
- string *Err = 0) {
+static bool LinkFunctionBodies(Module *Dest, const Module *Src,
+ map<const Value*, Value*> &ValueMap,
+ string *Err = 0) {
// Loop over all of the methods in the src module, mapping them over as we go
//
for (Module::const_iterator I = Src->begin(), E = Src->end(); I != E; ++I) {
- const Method *SM = *I; // Source Method
+ const Function *SM = *I; // Source Function
if (!SM->isExternal()) { // No body if method is external
- Method *DM = cast<Method>(ValueMap[SM]); // Destination method
+ Function *DM = cast<Function>(ValueMap[SM]); // Destination method
// DM not external SM external?
if (!DM->isExternal()) {
if (Err)
- *Err = "Method '" + (SM->hasName() ? SM->getName() : string("")) +
+ *Err = "Function '" + (SM->hasName() ? SM->getName() : string("")) +
"' body multiply defined!";
return true;
}
- if (LinkMethodBody(DM, SM, ValueMap, Err)) return true;
+ if (LinkFunctionBody(DM, SM, ValueMap, Err)) return true;
}
}
return false;
@@ -418,13 +418,13 @@ bool LinkModules(Module *Dest, const Module *Src, string *ErrorMsg = 0) {
// We do this so that when we begin processing method bodies, all of the
// global values that may be referenced are available in our ValueMap.
//
- if (LinkMethodProtos(Dest, Src, ValueMap, ErrorMsg)) return true;
+ if (LinkFunctionProtos(Dest, Src, ValueMap, ErrorMsg)) return true;
// Link in the method bodies that are defined in the source module into the
// DestModule. This consists basically of copying the method over and fixing
// up references to values.
//
- if (LinkMethodBodies(Dest, Src, ValueMap, ErrorMsg)) return true;
+ if (LinkFunctionBodies(Dest, Src, ValueMap, ErrorMsg)) return true;
return false;
}
diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp
index 1b6e71725a..06c25d366c 100644
--- a/lib/VMCore/Module.cpp
+++ b/lib/VMCore/Module.cpp
@@ -5,7 +5,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Module.h"
-#include "llvm/Method.h"
+#include "llvm/Function.h"
#include "llvm/GlobalVariable.h"
#include "llvm/InstrTypes.h"
#include "llvm/ValueHolderImpl.h"
@@ -18,7 +18,7 @@
// for having a DefHolderImpl.h file seperate from DefHolder.h! :(
//
template class ValueHolder<GlobalVariable, Module, Module>;
-template class ValueHolder<Method, Module, Module>;
+template class ValueHolder<Function, Module, Module>;
// Define the GlobalValueRefMap as a struct that wraps a map so that we don't
// have Module.h depend on <map>
@@ -29,15 +29,15 @@ struct GlobalValueRefMap : public std::map<GlobalValue*, ConstantPointerRef*>{
Module::Module()
: Value(Type::VoidTy, Value::ModuleVal, ""), SymTabValue(this),
- GlobalList(this, this), MethodList(this, this), GVRefMap(0) {
+ GlobalList(this, this), FunctionList(this, this), GVRefMap(0) {
}
Module::~Module() {
dropAllReferences();
GlobalList.delete_all();
GlobalList.setParent(0);
- MethodList.delete_all();
- MethodList.setParent(0);
+ FunctionList.delete_all();
+ FunctionList.setParent(0);
}
@@ -50,8 +50,8 @@ Module::~Module() {
// delete.
//
void Module::dropAllReferences() {
- for_each(MethodList.begin(), MethodList.end(),
- std::mem_fun(&Method::dropAllReferences));
+ for_each(FunctionList.begin(), FunctionList.end(),
+ std::mem_fun(&Function::dropAllReferences));
for_each(GlobalList.begin(), GlobalList.end(),
std::mem_fun(&GlobalVariable::dropAllReferences));
@@ -80,10 +80,10 @@ bool Module::reduceApply(bool (*Func)(GlobalVariable*)) {
bool Module::reduceApply(bool (*Func)(const GlobalVariable*)) const {
return reduce_apply_bool(gbegin(), gend(), Func);
}
-bool Module::reduceApply(bool (*Func)(Method*)) {
+bool Module::reduceApply(bool (*Func)(Function*)) {
return reduce_apply_bool(begin(), end(), Func);
}
-bool Module::reduceApply(bool (*Func)(const Method*)) const {
+bool Module::reduceApply(bool (*Func)(const Function*)) const {
return reduce_apply_bool(begin(), end(), Func);
}
diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp
index b6e222d98a..b607fe4b80 100644
--- a/lib/VMCore/Pass.cpp
+++ b/lib/VMCore/Pass.cpp
@@ -8,7 +8,7 @@
#include "llvm/PassManager.h"
#include "llvm/Module.h"
-#include "llvm/Method.h"
+#include "llvm/Function.h"
#include "llvm/BasicBlock.h"
#include "Support/STLExtras.h"
#include <algorithm>
@@ -59,8 +59,8 @@ void PMDebug::PrintPassInformation(unsigned Depth, const char *Action,
switch (V->getValueType()) {
case Value::ModuleVal:
std::cerr << "Module\n"; return;
- case Value::MethodVal:
- std::cerr << "Method '" << V->getName(); break;
+ case Value::FunctionVal:
+ std::cerr << "Function '" << V->getName(); break;
case Value::BasicBlockVal:
std::cerr << "BasicBlock '" << V->getName(); break;
default:
@@ -119,11 +119,11 @@ bool MethodPass::run(Module *M) {
// run - On a method, we simply initialize, run the method, then finalize.
//
-bool MethodPass::run(Method *M) {
- if (M->isExternal()) return false; // Passes are not run on external methods!
+bool MethodPass::run(Function *F) {
+ if (F->isExternal()) return false; // Passes are not run on external methods!
- return doInitialization(M->getParent()) | runOnMethod(M)
- | doFinalization(M->getParent());
+ return doInitialization(F->getParent()) | runOnMethod(F)
+ | doFinalization(F->getParent());
}
void MethodPass::addToPassManager(PassManagerT<Module> *PM,
@@ -132,7 +132,7 @@ void MethodPass::addToPassManager(PassManagerT<Module> *PM,
PM->addPass(this, Required, Destroyed, Provided);
}
-void MethodPass::addToPassManager(PassManagerT<Method> *PM,
+void MethodPass::addToPassManager(PassManagerT<Function> *PM,
AnalysisSet &Required, AnalysisSet &Destroyed,
AnalysisSet &Provided) {
PM->addPass(this, Required, Destroyed, Provided);
@@ -145,9 +145,9 @@ void MethodPass::addToPassManager(PassManagerT<Method> *PM,
// To run this pass on a method, we simply call runOnBasicBlock once for each
// method.
//
-bool BasicBlockPass::runOnMethod(Method *M) {
+bool BasicBlockPass::runOnMethod(Function *F) {
bool Changed = false;
- for (Method::iterator I = M->begin(), E = M->end(); I != E; ++I)
+ for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I)
Changed |= runOnBasicBlock(*I);
return Changed;
}
@@ -160,7 +160,7 @@ bool BasicBlockPass::run(BasicBlock *BB) {
return doInitialization(M) | runOnBasicBlock(BB) | doFinalization(M);
}
-void BasicBlockPass::addToPassManager(PassManagerT<Method> *PM,
+void BasicBlockPass::addToPassManager(PassManagerT<Function> *PM,
AnalysisSet &Required,
AnalysisSet &Destroyed,
AnalysisSet &Provided) {
diff --git a/lib/VMCore/SymbolTable.cpp b/lib/VMCore/SymbolTable.cpp
index 80f8e100e8..bd19291fa5 100644
--- a/lib/VMCore/SymbolTable.cpp
+++ b/lib/VMCore/SymbolTable.cpp
@@ -8,7 +8,7 @@
#include "llvm/InstrTypes.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
-#include "llvm/Method.h"
+#include "llvm/Function.h"
#include "Support/StringExtras.h"
#include <iostream>
@@ -238,8 +238,8 @@ void SymbolTable::refineAbstractType(const DerivedType *OldType,
// The only thing we are allowing for now is two method prototypes being
// folded into one.
//
- Method *ExistM = dyn_cast<Method>(TI->second);
- Method *NewM = dyn_cast<Method>(V.second);
+ Function *ExistM = dyn_cast<Function>(TI->second);
+ Function *NewM = dyn_cast<Function>(V.second);
if (ExistM && NewM && ExistM->isExternal() && NewM->isExternal()) {
// Ok we have two external methods. Make all uses of the new one
@@ -264,7 +264,7 @@ void SymbolTable::refineAbstractType(const DerivedType *OldType,
InternallyInconsistent = false;
// Now we can remove this method from the module entirely...
- NewM->getParent()->getMethodList().remove(NewM);
+ NewM->getParent()->getFunctionList().remove(NewM);
delete NewM;
} else {