Daniel Sanders | a16bd4f | 2019-08-20 22:53:24 +0000 | [diff] [blame^] | 1 | //===-- RISCVCallLowering.cpp - 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 implements the lowering of LLVM calls to machine code calls for |
| 11 | /// GlobalISel. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #include "RISCVCallLowering.h" |
| 16 | #include "RISCVISelLowering.h" |
| 17 | #include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h" |
| 18 | |
| 19 | using namespace llvm; |
| 20 | |
| 21 | RISCVCallLowering::RISCVCallLowering(const RISCVTargetLowering &TLI) |
| 22 | : CallLowering(&TLI) {} |
| 23 | |
| 24 | bool RISCVCallLowering::lowerReturn(MachineIRBuilder &MIRBuilder, |
| 25 | const Value *Val, |
| 26 | ArrayRef<Register> VRegs) const { |
| 27 | |
| 28 | MachineInstrBuilder Ret = MIRBuilder.buildInstrNoInsert(RISCV::PseudoRET); |
| 29 | |
| 30 | if (Val != nullptr) { |
| 31 | return false; |
| 32 | } |
| 33 | MIRBuilder.insertInstr(Ret); |
| 34 | return true; |
| 35 | } |
| 36 | |
| 37 | bool RISCVCallLowering::lowerFormalArguments( |
| 38 | MachineIRBuilder &MIRBuilder, const Function &F, |
| 39 | ArrayRef<ArrayRef<Register>> VRegs) const { |
| 40 | |
| 41 | if (F.arg_empty()) |
| 42 | return true; |
| 43 | |
| 44 | return false; |
| 45 | } |
| 46 | |
| 47 | bool RISCVCallLowering::lowerCall(MachineIRBuilder &MIRBuilder, |
| 48 | CallLoweringInfo &Info) const { |
| 49 | return false; |
| 50 | } |