mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
Convert to MachineFunctionPass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5218 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8d95ef4973
commit
f00a3f905e
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user