diff options
author | Matthias Braun <matze@braunis.de> | 2018-11-05 23:49:14 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2018-11-05 23:49:14 +0000 |
commit | 7a75a91b5b0e46afff5f8e0e9deb3833ce12a26a (patch) | |
tree | f5cd13ead11db685de7210cc2439860ab1596739 /llvm/lib | |
parent | 3d849f67cbae5807f18fb2d46dfccd3aeae3c39b (diff) | |
download | bcm5719-llvm-7a75a91b5b0e46afff5f8e0e9deb3833ce12a26a.tar.gz bcm5719-llvm-7a75a91b5b0e46afff5f8e0e9deb3833ce12a26a.zip |
MachineFunction: Store more specific reference to LLVMTargetMachine; NFC
MachineFunction can only be used in code using lib/CodeGen, hence we
can keep a more specific reference to LLVMTargetMachine rather than just
TargetMachine around.
Do the same for references in ScheduleDAG and RegUsageInfoCollector.
llvm-svn: 346183
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/CodeGen/RegUsageInfoCollector.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/RegisterUsageInfo.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 9e4963c4bdb..488481cec37 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -130,7 +130,8 @@ static inline unsigned getFnStackAlignment(const TargetSubtargetInfo *STI, return STI->getFrameLowering()->getStackAlignment(); } -MachineFunction::MachineFunction(const Function &F, const TargetMachine &Target, +MachineFunction::MachineFunction(const Function &F, + const LLVMTargetMachine &Target, const TargetSubtargetInfo &STI, unsigned FunctionNum, MachineModuleInfo &mmi) : F(F), Target(Target), STI(&STI), Ctx(mmi.getContext()), MMI(mmi) { diff --git a/llvm/lib/CodeGen/RegUsageInfoCollector.cpp b/llvm/lib/CodeGen/RegUsageInfoCollector.cpp index 9db2af9f962..66c7c5cd7db 100644 --- a/llvm/lib/CodeGen/RegUsageInfoCollector.cpp +++ b/llvm/lib/CodeGen/RegUsageInfoCollector.cpp @@ -81,7 +81,7 @@ FunctionPass *llvm::createRegUsageInfoCollector() { bool RegUsageInfoCollector::runOnMachineFunction(MachineFunction &MF) { MachineRegisterInfo *MRI = &MF.getRegInfo(); const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo(); - const TargetMachine &TM = MF.getTarget(); + const LLVMTargetMachine &TM = MF.getTarget(); LLVM_DEBUG(dbgs() << " -------------------- " << getPassName() << " -------------------- \n"); diff --git a/llvm/lib/CodeGen/RegisterUsageInfo.cpp b/llvm/lib/CodeGen/RegisterUsageInfo.cpp index 1b3fbc25b6e..6b9880a8913 100644 --- a/llvm/lib/CodeGen/RegisterUsageInfo.cpp +++ b/llvm/lib/CodeGen/RegisterUsageInfo.cpp @@ -40,7 +40,7 @@ INITIALIZE_PASS(PhysicalRegisterUsageInfo, "reg-usage-info", char PhysicalRegisterUsageInfo::ID = 0; -void PhysicalRegisterUsageInfo::setTargetMachine(const TargetMachine &TM) { +void PhysicalRegisterUsageInfo::setTargetMachine(const LLVMTargetMachine &TM) { this->TM = &TM; } diff --git a/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp b/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp index 9d9c75aceca..aec0d7db81a 100644 --- a/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp @@ -200,7 +200,7 @@ bool NVPTXAsmPrinter::lowerImageHandleOperand(const MachineInstr *MI, void NVPTXAsmPrinter::lowerImageHandleSymbol(unsigned Index, MCOperand &MCOp) { // Ewwww - TargetMachine &TM = const_cast<TargetMachine&>(MF->getTarget()); + LLVMTargetMachine &TM = const_cast<LLVMTargetMachine&>(MF->getTarget()); NVPTXTargetMachine &nvTM = static_cast<NVPTXTargetMachine&>(TM); const NVPTXMachineFunctionInfo *MFI = MF->getInfo<NVPTXMachineFunctionInfo>(); const char *Sym = MFI->getImageHandleSymbol(Index); |