LLVM  10.0.0svn
AArch64CallLowering.h
Go to the documentation of this file.
1 //===- AArch64CallLowering.h - Call lowering --------------------*- 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 /// \file
10 /// This file describes how to lower LLVM calls to machine code calls.
11 ///
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64CALLLOWERING_H
15 #define LLVM_LIB_TARGET_AARCH64_AARCH64CALLLOWERING_H
16 
17 #include "llvm/ADT/ArrayRef.h"
19 #include "llvm/IR/CallingConv.h"
20 #include <cstdint>
21 #include <functional>
22 
23 namespace llvm {
24 
25 class AArch64TargetLowering;
26 class CCValAssign;
27 class DataLayout;
28 class MachineIRBuilder;
29 class MachineRegisterInfo;
30 class Type;
31 
33 public:
35 
36  bool lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val,
37  ArrayRef<Register> VRegs,
38  Register SwiftErrorVReg) const override;
39 
40  bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F,
41  ArrayRef<ArrayRef<Register>> VRegs) const override;
42 
43  bool lowerCall(MachineIRBuilder &MIRBuilder,
44  CallLoweringInfo &Info) const override;
45 
46  bool supportSwiftError() const override { return true; }
47 
48 private:
49  using RegHandler = std::function<void(MachineIRBuilder &, Type *, unsigned,
50  CCValAssign &)>;
51 
52  using MemHandler =
53  std::function<void(MachineIRBuilder &, int, CCValAssign &)>;
54 
55  void splitToValueTypes(const ArgInfo &OrigArgInfo,
56  SmallVectorImpl<ArgInfo> &SplitArgs,
58  CallingConv::ID CallConv) const;
59 };
60 
61 } // end namespace llvm
62 
63 #endif // LLVM_LIB_TARGET_AARCH64_AARCH64CALLLOWERING_H
A parsed version of the target data layout string in and methods for querying it. ...
Definition: DataLayout.h:111
Type
MessagePack types as defined in the standard, with the exception of Integer being divided into a sign...
Definition: MsgPackReader.h:48
This class represents lattice values for constants.
Definition: AllocatorList.h:23
F(f)
bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F, ArrayRef< ArrayRef< Register >> VRegs) const override
This hook must be implemented to lower the incoming (formal) arguments, described by VRegs...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:41
bool supportSwiftError() const override
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:32
Analysis containing CSE Info
Definition: CSEInfo.cpp:20
unsigned const MachineRegisterInfo * MRI
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:45
Helper class to build MachineInstr.
bool lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val, ArrayRef< Register > VRegs, Register SwiftErrorVReg) const override
This hook must be implemented to lower outgoing return values, described by Val, into the specified v...
bool lowerCall(MachineIRBuilder &MIRBuilder, CallLoweringInfo &Info) const override
This hook must be implemented to lower the given call instruction, including argument and return valu...
CCValAssign - Represent assignment of one arg/retval to a location.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
LLVM Value Representation.
Definition: Value.h:73
This file describes how to lower LLVM calls to machine code calls.
print Print MemDeps of function
AArch64CallLowering(const AArch64TargetLowering &TLI)
Wrapper class representing virtual and physical registers.
Definition: Register.h:19