mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-02 21:31:41 +00:00
[GlobalISel] Add missing file in previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260923 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
30880b6d80
commit
849184df82
72
include/llvm/CodeGen/GlobalISel/CallLowering.h
Normal file
72
include/llvm/CodeGen/GlobalISel/CallLowering.h
Normal file
@ -0,0 +1,72 @@
|
||||
//===-- llvm/CodeGen/GlobalISel/CallLowering.h - Call lowering --*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
///
|
||||
/// \file
|
||||
/// This file describes how to lower LLVM calls to machine code calls.
|
||||
///
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_CODEGEN_GLOBALISEL_CALLLOWERING_H
|
||||
#define LLVM_CODEGEN_GLOBALISEL_CALLLOWERING_H
|
||||
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/IR/Function.h"
|
||||
|
||||
namespace llvm {
|
||||
// Forward declarations.
|
||||
class MachineIRBuilder;
|
||||
class TargetLowering;
|
||||
class Value;
|
||||
|
||||
class CallLowering {
|
||||
const TargetLowering *TLI;
|
||||
protected:
|
||||
/// Getter for generic TargetLowering class.
|
||||
const TargetLowering *getTLI() const {
|
||||
return TLI;
|
||||
}
|
||||
|
||||
/// Getter for target specific TargetLowering class.
|
||||
template <class XXXTargetLowering>
|
||||
const XXXTargetLowering *getTLI() const {
|
||||
return static_cast<const XXXTargetLowering *>(TLI);
|
||||
}
|
||||
public:
|
||||
CallLowering(const TargetLowering *TLI) : TLI(TLI) {}
|
||||
virtual ~CallLowering() {}
|
||||
|
||||
/// This hook must be implemented to lower outgoing return values, described
|
||||
/// by \p Val, into the specified virtual register \p VReg.
|
||||
/// This hook is used by GlobalISel.
|
||||
///
|
||||
/// \return True if the lowering succeeds, false otherwise.
|
||||
virtual bool LowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val,
|
||||
unsigned VReg) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
/// This hook must be implemented to lower the incoming (formal)
|
||||
/// arguments, described by \p Args, for GlobalISel. Each argument
|
||||
/// must end up in the related virtual register described by VRegs.
|
||||
/// In other words, the first argument should end up in VRegs[0],
|
||||
/// the second in VRegs[1], and so on.
|
||||
/// \p MIRBuilder is set to the proper insertion for the argument
|
||||
/// lowering.
|
||||
///
|
||||
/// \return True if the lowering succeeded, false otherwise.
|
||||
virtual bool
|
||||
LowerFormalArguments(MachineIRBuilder &MIRBuilder,
|
||||
const Function::ArgumentListType &Args,
|
||||
const SmallVectorImpl<unsigned> &VRegs) const {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
} // End namespace llvm.
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user