change refs to Method to Function
authorChris Lattner <sabre@nondot.org>
Tue, 26 Mar 2002 17:55:33 +0000 (17:55 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 26 Mar 2002 17:55:33 +0000 (17:55 +0000)
Change references to MEthodArgument to FunctionArgument

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1989 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/Expressions.cpp
lib/Analysis/IPA/CallGraph.cpp
lib/Analysis/InductionVariable.cpp

index 00a8307143436c619af91f32658e47aa12bfae40..4a7646e4d76001b205bfd8385cebd40d48aac6c3 100644 (file)
@@ -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);
index 6a5cad4244a3dabc2bf3bc07c0813be5473a073f..98dfbf7e26f1e9df1455edbe74e10a974013d45a 100644 (file)
@@ -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
-  MethodMap.erase(M);            // Remove the call graph node from the map
+  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;
 }
 
index 045c9323328dd141fef9bc613276a3f690a7f6eb..11d1a2c860eb665d7ab0049a372429a168e89614 100644 (file)
@@ -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);