65816-llvm-mos/src/llvm/lib/Target/W65816/W65816MachineFunctionInfo.h
2026-04-30 18:49:00 -05:00

73 lines
2.5 KiB
C++

//=== W65816MachineFunctionInfo.h - W65816 machine function info -*- C++ -*-==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file declares W65816-specific per-machine-function information.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIB_TARGET_W65816_W65816MACHINEFUNCTIONINFO_H
#define LLVM_LIB_TARGET_W65816_W65816MACHINEFUNCTIONINFO_H
#include "llvm/CodeGen/MachineFunction.h"
namespace llvm {
/// W65816MachineFunctionInfo - per-MachineFunction private target-specific
/// information for the W65816.
class W65816MachineFunctionInfo : public MachineFunctionInfo {
virtual void anchor();
/// Size of the callee-saved register portion of the stack frame in bytes.
unsigned CalleeSavedFrameSize = 0;
/// FrameIndex for the return-address slot.
int ReturnAddrIndex = 0;
/// FrameIndex for the start of the varargs area.
int VarArgsFrameIndex = 0;
/// Virtual register holding the struct-return pointer for sret returns.
Register SRetReturnReg;
/// True iff the function's prologue chose 8-bit M (SEP #$20). Pure-i8
/// functions run with M=1; everything else runs with M=0. AsmPrinter
/// reads this when expanding pseudos whose width depends on M (e.g.
/// STA8abs needs an SEP/REP wrap in M=0 to avoid a 2-byte store).
bool UsesAcc8 = false;
public:
W65816MachineFunctionInfo() = default;
W65816MachineFunctionInfo(const Function &F, const TargetSubtargetInfo *STI) {
}
MachineFunctionInfo *
clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
const override;
unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize; }
void setCalleeSavedFrameSize(unsigned Bytes) { CalleeSavedFrameSize = Bytes; }
Register getSRetReturnReg() const { return SRetReturnReg; }
void setSRetReturnReg(Register Reg) { SRetReturnReg = Reg; }
int getRAIndex() const { return ReturnAddrIndex; }
void setRAIndex(int Index) { ReturnAddrIndex = Index; }
int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; }
bool getUsesAcc8() const { return UsesAcc8; }
void setUsesAcc8(bool V) { UsesAcc8 = V; }
};
} // namespace llvm
#endif