1//===---- MipsCCState.h - CCState with Mips specific extensions -----------===//
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#ifndef MIPSCCSTATE_H
10#define MIPSCCSTATE_H
11
12#include "MipsISelLowering.h"
13#include "llvm/ADT/SmallVector.h"
14#include "llvm/CodeGen/CallingConvLower.h"
15
16namespace llvm {
17class SDNode;
18class MipsSubtarget;
19
20class MipsCCState : public CCState {
21public:
22 enum SpecialCallingConvType { Mips16RetHelperConv, NoSpecialCallingConv };
23
24 /// Determine the SpecialCallingConvType for the given callee
25 static SpecialCallingConvType
26 getSpecialCallingConvForCallee(const SDNode *Callee,
27 const MipsSubtarget &Subtarget);
28
29private:
30 // Used to handle MIPS16-specific calling convention tweaks.
31 // FIXME: This should probably be a fully fledged calling convention.
32 SpecialCallingConvType SpecialCallingConv;
33
34public:
35 MipsCCState(CallingConv::ID CC, bool isVarArg, MachineFunction &MF,
36 SmallVectorImpl<CCValAssign> &locs, LLVMContext &C,
37 SpecialCallingConvType SpecialCC = NoSpecialCallingConv)
38 : CCState(CC, isVarArg, MF, locs, C), SpecialCallingConv(SpecialCC) {}
39
40 SpecialCallingConvType getSpecialCallingConv() { return SpecialCallingConv; }
41};
42}
43
44#endif
45