aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/PrologEpilogInserter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-01-13 00:23:41 +0000
committerChris Lattner <sabre@nondot.org>2003-01-13 00:23:41 +0000
commitf00a3f905e8cd99ab4d3dbbde1a9d510516e0fa2 (patch)
tree4a8a16c185f232be751937179606d0ef3f9199b7 /lib/CodeGen/PrologEpilogInserter.cpp
parent8d95ef4973226044cefdd6dc237d3c326ffc15b3 (diff)
Convert to MachineFunctionPass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5218 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PrologEpilogInserter.cpp')
-rw-r--r--lib/CodeGen/PrologEpilogInserter.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp
index 91c113d186..0d57b1059b 100644
--- a/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/lib/CodeGen/PrologEpilogInserter.cpp
@@ -9,8 +9,8 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/Pass.h"
-#include "llvm/CodeGen/MachineFunction.h"
+#include "llvm/CodeGen/Passes.h"
+#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/Target/TargetMachine.h"
@@ -19,9 +19,9 @@
#include "llvm/Target/MachineInstrInfo.h"
namespace {
- struct PEI : public FunctionPass {
- bool runOnFunction(Function &Fn) {
- return runOnMachineFunction(MachineFunction::get(&Fn));
+ struct PEI : public MachineFunctionPass {
+ const char *getPassName() const {
+ return "Prolog/Epilog Insertion & Frame Finalization";
}
/// runOnMachineFunction - Insert prolog/epilog code and replace abstract
@@ -141,8 +141,7 @@ void PEI::saveCallerSavedRegisters(MachineFunction &Fn) {
// stack slots for them.
std::vector<int> StackSlots;
for (unsigned i = 0, e = RegsToSave.size(); i != e; ++i) {
- const TargetRegisterClass *RC = RegInfo->getRegClass(RegsToSave[i]);
- int FrameIdx = FFI->CreateStackObject(RC->getSize(), RC->getAlignment());
+ int FrameIdx = FFI->CreateStackObject(RegInfo->getRegClass(RegsToSave[i]));
StackSlots.push_back(FrameIdx);
}