LLVM: lib/Target/M68k/M68kCallingConv.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef LLVM_LIB_TARGET_M68K_M68KCALLINGCONV_H
16#define LLVM_LIB_TARGET_M68K_M68KCALLINGCONV_H
17
19
23
24namespace llvm {
25
26
35
36
37
42
43 static const MCPhysReg DataRegList[] = {M68k::D0, M68k::D1, M68k::A0,
44 M68k::A1};
45
46
47 static const MCPhysReg AddrRegList[] = {
48 M68k::A0,
49 M68k::A1,
50 M68k::D0,
51 M68k::D1,
52 };
53
54 const auto &ArgTypes = CCInfo.ArgTypeList;
55 auto I = ArgTypes.begin(), End = ArgTypes.end();
56 int No = ValNo;
57 while (No > 0 && I != End) {
58 No -= (*I)->isIntegerTy(64) ? 2 : 1;
59 ++I;
60 }
61
62 bool IsPtr = I != End && (*I)->isPointerTy();
63
64 unsigned Reg =
65 IsPtr ? State.AllocateReg(AddrRegList) : State.AllocateReg(DataRegList);
66
67 if (Reg) {
69 return true;
70 }
71
72 return false;
73}
74
75}
76
77#endif
This file provides M68k specific target descriptions.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
CCState - This class holds information needed while lowering arguments and return values.
LLVM_ABI CCState(CallingConv::ID CC, bool IsVarArg, MachineFunction &MF, SmallVectorImpl< CCValAssign > &Locs, LLVMContext &Context, bool NegativeOffsets=false)
static CCValAssign getReg(unsigned ValNo, MVT ValVT, MCRegister Reg, MVT LocVT, LocInfo HTP, bool IsCustom=false)
This is an important class for using LLVM in a threaded context.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
bool CC_M68k_Any_AssignToReg(unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)
NOTE this function is used to select registers for formal arguments and call FIXME: Handling on point...
Definition M68kCallingConv.h:38
Custom state to propagate llvm type info to register CC assigner.
Definition M68kCallingConv.h:27
M68kCCState(ArrayRef< Type * > ArgTypes, CallingConv::ID CC, bool IsVarArg, MachineFunction &MF, SmallVectorImpl< CCValAssign > &Locs, LLVMContext &C)
Definition M68kCallingConv.h:30
ArrayRef< Type * > ArgTypeList
Definition M68kCallingConv.h:28