1*700637cbSDimitry Andric //==- XtensaMachineFunctionInfo.h - Xtensa machine function info --*- C++ -*-=// 2*700637cbSDimitry Andric // 3*700637cbSDimitry Andric // The LLVM Compiler Infrastructure 4*700637cbSDimitry Andric // 5*700637cbSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 6*700637cbSDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 7*700637cbSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 8*700637cbSDimitry Andric // 9*700637cbSDimitry Andric //===----------------------------------------------------------------------===// 10*700637cbSDimitry Andric // 11*700637cbSDimitry Andric // This file declares Xtensa-specific per-machine-function information. 12*700637cbSDimitry Andric // 13*700637cbSDimitry Andric //===----------------------------------------------------------------------===// 14*700637cbSDimitry Andric 15*700637cbSDimitry Andric #ifndef LLVM_LIB_TARGET_XTENSA_XTENSAMACHINEFUNCTIONINFO_H 16*700637cbSDimitry Andric #define LLVM_LIB_TARGET_XTENSA_XTENSAMACHINEFUNCTIONINFO_H 17*700637cbSDimitry Andric 18*700637cbSDimitry Andric #include "llvm/CodeGen/MachineFrameInfo.h" 19*700637cbSDimitry Andric #include "llvm/CodeGen/MachineFunction.h" 20*700637cbSDimitry Andric #include "llvm/Target/TargetMachine.h" 21*700637cbSDimitry Andric 22*700637cbSDimitry Andric namespace llvm { 23*700637cbSDimitry Andric 24*700637cbSDimitry Andric class XtensaMachineFunctionInfo : public MachineFunctionInfo { 25*700637cbSDimitry Andric /// FrameIndex of the spill slot for the scratch register in BranchRelaxation. 26*700637cbSDimitry Andric int BranchRelaxationScratchFrameIndex = -1; 27*700637cbSDimitry Andric unsigned VarArgsFirstGPR; 28*700637cbSDimitry Andric int VarArgsOnStackFrameIndex; 29*700637cbSDimitry Andric int VarArgsInRegsFrameIndex; 30*700637cbSDimitry Andric bool SaveFrameRegister = false; 31*700637cbSDimitry Andric unsigned CPLabelId = 0; 32*700637cbSDimitry Andric 33*700637cbSDimitry Andric public: XtensaMachineFunctionInfo(const Function & F,const TargetSubtargetInfo * STI)34*700637cbSDimitry Andric explicit XtensaMachineFunctionInfo(const Function &F, 35*700637cbSDimitry Andric const TargetSubtargetInfo *STI) 36*700637cbSDimitry Andric : VarArgsFirstGPR(0), VarArgsOnStackFrameIndex(0), 37*700637cbSDimitry Andric VarArgsInRegsFrameIndex(0) {} 38*700637cbSDimitry Andric getBranchRelaxationScratchFrameIndex()39*700637cbSDimitry Andric int getBranchRelaxationScratchFrameIndex() const { 40*700637cbSDimitry Andric return BranchRelaxationScratchFrameIndex; 41*700637cbSDimitry Andric } setBranchRelaxationScratchFrameIndex(int Index)42*700637cbSDimitry Andric void setBranchRelaxationScratchFrameIndex(int Index) { 43*700637cbSDimitry Andric BranchRelaxationScratchFrameIndex = Index; 44*700637cbSDimitry Andric } 45*700637cbSDimitry Andric getVarArgsFirstGPR()46*700637cbSDimitry Andric unsigned getVarArgsFirstGPR() const { return VarArgsFirstGPR; } setVarArgsFirstGPR(unsigned GPR)47*700637cbSDimitry Andric void setVarArgsFirstGPR(unsigned GPR) { VarArgsFirstGPR = GPR; } 48*700637cbSDimitry Andric getVarArgsOnStackFrameIndex()49*700637cbSDimitry Andric int getVarArgsOnStackFrameIndex() const { return VarArgsOnStackFrameIndex; } setVarArgsOnStackFrameIndex(int FI)50*700637cbSDimitry Andric void setVarArgsOnStackFrameIndex(int FI) { VarArgsOnStackFrameIndex = FI; } 51*700637cbSDimitry Andric 52*700637cbSDimitry Andric // Get and set the frame index of the first stack vararg. getVarArgsInRegsFrameIndex()53*700637cbSDimitry Andric int getVarArgsInRegsFrameIndex() const { return VarArgsInRegsFrameIndex; } setVarArgsInRegsFrameIndex(int FI)54*700637cbSDimitry Andric void setVarArgsInRegsFrameIndex(int FI) { VarArgsInRegsFrameIndex = FI; } 55*700637cbSDimitry Andric isSaveFrameRegister()56*700637cbSDimitry Andric bool isSaveFrameRegister() const { return SaveFrameRegister; } setSaveFrameRegister()57*700637cbSDimitry Andric void setSaveFrameRegister() { SaveFrameRegister = true; } 58*700637cbSDimitry Andric createCPLabelId()59*700637cbSDimitry Andric unsigned createCPLabelId() { return CPLabelId++; } 60*700637cbSDimitry Andric }; 61*700637cbSDimitry Andric 62*700637cbSDimitry Andric } // namespace llvm 63*700637cbSDimitry Andric 64*700637cbSDimitry Andric #endif /* LLVM_LIB_TARGET_XTENSA_XTENSAMACHINEFUNCTIONINFO_H */ 65