aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/SparcV9/SparcV9TargetMachine.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-06-25 16:13:21 +0000
committerChris Lattner <sabre@nondot.org>2002-06-25 16:13:21 +0000
commit0b12b5f50ec77a8bd01b92d287c52d748619bb4b (patch)
tree5764db59facb124b023f1de96f0e45d37657c82e /lib/Target/SparcV9/SparcV9TargetMachine.cpp
parent18961504fc2b299578dba817900a0696cf3ccc4d (diff)
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
Diffstat (limited to 'lib/Target/SparcV9/SparcV9TargetMachine.cpp')
-rw-r--r--lib/Target/SparcV9/SparcV9TargetMachine.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/lib/Target/SparcV9/SparcV9TargetMachine.cpp b/lib/Target/SparcV9/SparcV9TargetMachine.cpp
index fecdf23e29..be6e9f4670 100644
--- a/lib/Target/SparcV9/SparcV9TargetMachine.cpp
+++ b/lib/Target/SparcV9/SparcV9TargetMachine.cpp
@@ -135,8 +135,8 @@ public:
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 @@ public:
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 @@ public:
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;
}