1 //===-- llvm/lib/Target/X86/X86CallLowering.cpp - Call lowering -----------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// This file implements the lowering of LLVM calls to machine code calls for
14 //===----------------------------------------------------------------------===//
16 #include "X86CallLowering.h"
17 #include "X86ISelLowering.h"
18 #include "X86InstrInfo.h"
19 #include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
23 #ifndef LLVM_BUILD_GLOBAL_ISEL
24 #error "This shouldn't be built without GISel"
27 X86CallLowering::X86CallLowering(const X86TargetLowering &TLI)
28 : CallLowering(&TLI) {}
30 bool X86CallLowering::lowerReturn(MachineIRBuilder &MIRBuilder,
31 const Value *Val, unsigned VReg) const {
32 // TODO: handle functions returning non-void values.
36 MIRBuilder.buildInstr(X86::RET).addImm(0);
41 bool X86CallLowering::lowerFormalArguments(MachineIRBuilder &MIRBuilder,
43 ArrayRef<unsigned> VRegs) const {
44 // TODO: handle functions with one or more arguments.