Make the TargetMachine::getSubtarget that takes a Function argument
authorEric Christopher <echristo@gmail.com>
Fri, 20 Feb 2015 07:32:59 +0000 (07:32 +0000)
committerEric Christopher <echristo@gmail.com>
Fri, 20 Feb 2015 07:32:59 +0000 (07:32 +0000)
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
lib/Target/ARM/ARMAsmPrinter.h
lib/Target/PowerPC/PPCAsmPrinter.cpp

index af1fcd6cade2c3ae87af1a0b3c98d07ab1f24dc5..cdf643d69e0a9870c506a7b71e16adf1fde8216d 100644 (file)
@@ -113,7 +113,7 @@ public:
   template<typename STC> const STC &getSubtarget() const {
     return *static_cast<const STC*>(getSubtargetImpl());
   }
-  template <typename STC> const STC &getSubtarget(const Function *) const {
+  template <typename STC> const STC &getSubtarget(const Function &) const {
     return *static_cast<const STC*>(getSubtargetImpl());
   }
 
index 2401d0cd848834d290a2897931cf2eb9fe59eecf..50cb95404119d63c9f45268f9c2eb2ec4339d669 100644 (file)
@@ -108,7 +108,7 @@ public:
     Triple TT(TM.getTargetTriple());
     if (!TT.isOSBinFormatMachO())
       return 0;
-    const ARMSubtarget &STI = TM.getSubtarget<ARMSubtarget>(F);
+    const ARMSubtarget &STI = TM.getSubtarget<ARMSubtarget>(*F);
     return STI.isThumb() ? ARM::DW_ISA_ARM_thumb : ARM::DW_ISA_ARM_arm;
   }
 
index f92b405b608884393446773051678920f703b99b..2a46b186a42e7fa6f6c6baef2b59ff0bceef75ab 100644 (file)
@@ -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<PPCSubtarget>(&F);
+    const PPCSubtarget &STI = TM.getSubtarget<PPCSubtarget>(F);
     unsigned FDir = STI.getDarwinDirective();
     Directive = Directive > FDir ? FDir : STI.getDarwinDirective();
     if (STI.hasMFOCRF() && Directive < PPC::DIR_970)