summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2016-02-16 00:57:44 +0000
committerQuentin Colombet <qcolombet@apple.com>2016-02-16 00:57:44 +0000
commit1ce38545fb142740944e5f268ec6c4b543f706f5 (patch)
tree11796c2764a0a4d3c664dc3dd71916f81bda926e /llvm/lib/CodeGen
parent23c89f359a2460f136b6a7115b9e11eac04501ac (diff)
downloadbcm5719-llvm-1ce38545fb142740944e5f268ec6c4b543f706f5.tar.gz
bcm5719-llvm-1ce38545fb142740944e5f268ec6c4b543f706f5.zip
[GlobalISel] Get rid of the ifdefs in TargetLowering.
Introduce a new API used only by GlobalISel: CallLowering. This API will contain target hooks dedicated to call lowering. llvm-svn: 260922
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
index ffbda5ba591..b1a8332d608 100644
--- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
@@ -13,6 +13,7 @@
#include "llvm/CodeGen/GlobalISel/IRTranslator.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/CodeGen/GlobalISel/CallLowering.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/IR/Constant.h"
@@ -75,7 +76,7 @@ bool IRTranslator::translateReturn(const Instruction &Inst) {
// The target may mess up with the insertion point, but
// this is not important as a return is the last instruction
// of the block anyway.
- return TLI->LowerReturn(MIRBuilder, Ret,
+ return CLI->LowerReturn(MIRBuilder, Ret,
!Ret ? 0 : getOrCreateVReg(Ret));
}
@@ -104,7 +105,7 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &MF) {
const Function &F = *MF.getFunction();
if (F.empty())
return false;
- TLI = MF.getSubtarget().getTargetLowering();
+ CLI = MF.getSubtarget().getCallLowering();
MIRBuilder.setFunction(MF);
MRI = &MF.getRegInfo();
// Setup the arguments.
@@ -113,7 +114,7 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &MF) {
SmallVector<unsigned, 8> VRegArgs;
for (const Argument &Arg: F.args())
VRegArgs.push_back(getOrCreateVReg(&Arg));
- bool Succeeded = TLI->LowerFormalArguments(MIRBuilder, F.getArgumentList(),
+ bool Succeeded = CLI->LowerFormalArguments(MIRBuilder, F.getArgumentList(),
VRegArgs);
if (!Succeeded)
report_fatal_error("Unable to lower arguments");
OpenPOWER on IntegriCloud