brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 9c21121 Raw
59 lines · c
1//===- ARCMachineFunctionInfo.h - ARC machine function info -----*- C++ -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8//9// This file declares ARC-specific per-machine-function information.10//11//===----------------------------------------------------------------------===//12 13#ifndef LLVM_LIB_TARGET_ARC_ARCMACHINEFUNCTIONINFO_H14#define LLVM_LIB_TARGET_ARC_ARCMACHINEFUNCTIONINFO_H15 16#include "llvm/CodeGen/MachineFunction.h"17 18namespace llvm {19 20/// ARCFunctionInfo - This class is derived from MachineFunction private21/// ARC target-specific information for each MachineFunction.22class ARCFunctionInfo : public MachineFunctionInfo {23  virtual void anchor();24  bool ReturnStackOffsetSet;25  int VarArgsFrameIndex;26  unsigned ReturnStackOffset;27 28public:29  explicit ARCFunctionInfo(const Function &F, const TargetSubtargetInfo *STI)30      : ReturnStackOffsetSet(false), VarArgsFrameIndex(0),31        ReturnStackOffset(-1U), MaxCallStackReq(0) {}32  ~ARCFunctionInfo() {}33 34  MachineFunctionInfo *35  clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,36        const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)37      const override;38 39  void setVarArgsFrameIndex(int off) { VarArgsFrameIndex = off; }40  int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }41 42  void setReturnStackOffset(unsigned value) {43    assert(!ReturnStackOffsetSet && "Return stack offset set twice");44    ReturnStackOffset = value;45    ReturnStackOffsetSet = true;46  }47 48  unsigned getReturnStackOffset() const {49    assert(ReturnStackOffsetSet && "Return stack offset not set");50    return ReturnStackOffset;51  }52 53  unsigned MaxCallStackReq;54};55 56} // end namespace llvm57 58#endif // LLVM_LIB_TARGET_ARC_ARCMACHINEFUNCTIONINFO_H59