MEGAPATCH checkin.

For details, See: docs/2002-06-25-MegaPatchInfo.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2778 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/SparcV9/SparcV9TargetMachine.cpp b/lib/Target/SparcV9/SparcV9TargetMachine.cpp
index fecdf23..be6e9f4 100644
--- a/lib/Target/SparcV9/SparcV9TargetMachine.cpp
+++ b/lib/Target/SparcV9/SparcV9TargetMachine.cpp
@@ -135,8 +135,8 @@
     return "Sparc ConstructMachineCodeForFunction";
   }
 
-  bool runOnFunction(Function *F) {
-    MachineCodeForMethod::construct(F, Target);
+  bool runOnFunction(Function &F) {
+    MachineCodeForMethod::construct(&F, Target);
     return false;
   }
 };
@@ -147,9 +147,9 @@
   inline InstructionSelection(TargetMachine &T) : Target(T) {}
   const char *getPassName() const { return "Sparc Instruction Selection"; }
 
-  bool runOnFunction(Function *F) {
-    if (SelectInstructionsForMethod(F, Target)) {
-      cerr << "Instr selection failed for function " << F->getName() << "\n";
+  bool runOnFunction(Function &F) {
+    if (SelectInstructionsForMethod(&F, Target)) {
+      cerr << "Instr selection failed for function " << F.getName() << "\n";
       abort();
     }
     return false;
@@ -159,20 +159,17 @@
 struct FreeMachineCodeForFunction : public FunctionPass {
   const char *getPassName() const { return "Sparc FreeMachineCodeForFunction"; }
 
-  static void freeMachineCode(Instruction *I) {
-    MachineCodeForInstruction::destroy(I);
+  static void freeMachineCode(Instruction &I) {
+    MachineCodeForInstruction::destroy(&I);
   }
   
-  bool runOnFunction(Function *F) {
-    for (Function::iterator FI = F->begin(), FE = F->end(); FI != FE; ++FI)
-      for (BasicBlock::iterator I = (*FI)->begin(), E = (*FI)->end();
-           I != E; ++I)
-        MachineCodeForInstruction::get(*I).dropAllReferences();
+  bool runOnFunction(Function &F) {
+    for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI)
+      for (BasicBlock::iterator I = FI->begin(), E = FI->end(); I != E; ++I)
+        MachineCodeForInstruction::get(I).dropAllReferences();
     
-    for (Function::iterator FI = F->begin(), FE = F->end(); FI != FE; ++FI)
-      for (BasicBlock::iterator I = (*FI)->begin(), E = (*FI)->end();
-           I != E; ++I)
-        freeMachineCode(*I);
+    for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI)
+      for_each(FI->begin(), FI->end(), freeMachineCode);
     
     return false;
   }