AMDGPU: Mark test as XFAIL in expensive_checks builds
[llvm-project.git] / llvm / lib / Target / AVR / AVRMachineFunctionInfo.h
blob45c367a4dcd493fae885bf260ce4b6fe728c4c8f
1 //===-- AVRMachineFuctionInfo.h - AVR 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-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file declares AVR-specific per-machine-function information.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_AVR_MACHINE_FUNCTION_INFO_H
14 #define LLVM_AVR_MACHINE_FUNCTION_INFO_H
16 #include "llvm/CodeGen/MachineFunction.h"
18 namespace llvm {
20 /// Contains AVR-specific information for each MachineFunction.
21 class AVRMachineFunctionInfo : public MachineFunctionInfo {
22 /// Indicates if a register has been spilled by the register
23 /// allocator.
24 bool HasSpills;
26 /// Indicates if there are any fixed size allocas present.
27 /// Note that if there are only variable sized allocas this is set to false.
28 bool HasAllocas;
30 /// Indicates if arguments passed using the stack are being
31 /// used inside the function.
32 bool HasStackArgs;
34 /// Whether or not the function is an interrupt handler.
35 bool IsInterruptHandler;
37 /// Whether or not the function is an non-blocking interrupt handler.
38 bool IsSignalHandler;
40 /// Size of the callee-saved register portion of the
41 /// stack frame in bytes.
42 unsigned CalleeSavedFrameSize;
44 /// FrameIndex for start of varargs area.
45 int VarArgsFrameIndex;
47 public:
48 AVRMachineFunctionInfo(const Function &F, const TargetSubtargetInfo *STI)
49 : HasSpills(false), HasAllocas(false), HasStackArgs(false),
50 CalleeSavedFrameSize(0), VarArgsFrameIndex(0) {
51 CallingConv::ID CallConv = F.getCallingConv();
53 this->IsInterruptHandler =
54 CallConv == CallingConv::AVR_INTR || F.hasFnAttribute("interrupt");
55 this->IsSignalHandler =
56 CallConv == CallingConv::AVR_SIGNAL || F.hasFnAttribute("signal");
59 MachineFunctionInfo *
60 clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
61 const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
62 const override {
63 return DestMF.cloneInfo<AVRMachineFunctionInfo>(*this);
66 bool getHasSpills() const { return HasSpills; }
67 void setHasSpills(bool B) { HasSpills = B; }
69 bool getHasAllocas() const { return HasAllocas; }
70 void setHasAllocas(bool B) { HasAllocas = B; }
72 bool getHasStackArgs() const { return HasStackArgs; }
73 void setHasStackArgs(bool B) { HasStackArgs = B; }
75 /// Checks if the function is some form of interrupt service routine.
76 bool isInterruptOrSignalHandler() const {
77 return isInterruptHandler() || isSignalHandler();
80 bool isInterruptHandler() const { return IsInterruptHandler; }
81 bool isSignalHandler() const { return IsSignalHandler; }
83 unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize; }
84 void setCalleeSavedFrameSize(unsigned Bytes) { CalleeSavedFrameSize = Bytes; }
86 int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
87 void setVarArgsFrameIndex(int Idx) { VarArgsFrameIndex = Idx; }
90 } // namespace llvm
92 #endif // LLVM_AVR_MACHINE_FUNCTION_INFO_H