From c9d071599711f0fcb7e7e227f05735be2b421fbe Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Fri, 20 Feb 2015 07:32:59 +0000 Subject: [PATCH] Make the TargetMachine::getSubtarget that takes a Function argument take a reference to match the getSubtargetImpl that takes a Function argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229994 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Target/TargetMachine.h | 2 +- lib/Target/ARM/ARMAsmPrinter.h | 2 +- lib/Target/PowerPC/PPCAsmPrinter.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h index af1fcd6cade..cdf643d69e0 100644 --- a/include/llvm/Target/TargetMachine.h +++ b/include/llvm/Target/TargetMachine.h @@ -113,7 +113,7 @@ public: template const STC &getSubtarget() const { return *static_cast(getSubtargetImpl()); } - template const STC &getSubtarget(const Function *) const { + template const STC &getSubtarget(const Function &) const { return *static_cast(getSubtargetImpl()); } diff --git a/lib/Target/ARM/ARMAsmPrinter.h b/lib/Target/ARM/ARMAsmPrinter.h index 2401d0cd848..50cb9540411 100644 --- a/lib/Target/ARM/ARMAsmPrinter.h +++ b/lib/Target/ARM/ARMAsmPrinter.h @@ -108,7 +108,7 @@ public: Triple TT(TM.getTargetTriple()); if (!TT.isOSBinFormatMachO()) return 0; - const ARMSubtarget &STI = TM.getSubtarget(F); + const ARMSubtarget &STI = TM.getSubtarget(*F); return STI.isThumb() ? ARM::DW_ISA_ARM_thumb : ARM::DW_ISA_ARM_arm; } diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index f92b405b608..2a46b186a42 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -1249,7 +1249,7 @@ void PPCDarwinAsmPrinter::EmitStartOfAsmFile(Module &M) { // FIXME: How should we merge darwin directives? unsigned Directive = PPC::DIR_NONE; for (const Function &F : M) { - const PPCSubtarget &STI = TM.getSubtarget(&F); + const PPCSubtarget &STI = TM.getSubtarget(F); unsigned FDir = STI.getDarwinDirective(); Directive = Directive > FDir ? FDir : STI.getDarwinDirective(); if (STI.hasMFOCRF() && Directive < PPC::DIR_970) -- 2.34.1