[llvm] r229994 - Make the TargetMachine::getSubtarget that takes a Function argument

Eric Christopher echristo at gmail.com
Thu Feb 19 23:33:00 PST 2015


Author: echristo
Date: Fri Feb 20 01:32:59 2015
New Revision: 229994

URL: http://llvm.org/viewvc/llvm-project?rev=229994&view=rev
Log:
Make the TargetMachine::getSubtarget that takes a Function argument
take a reference to match the getSubtargetImpl that takes a Function
argument.

Modified:
    llvm/trunk/include/llvm/Target/TargetMachine.h
    llvm/trunk/lib/Target/ARM/ARMAsmPrinter.h
    llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp

Modified: llvm/trunk/include/llvm/Target/TargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetMachine.h?rev=229994&r1=229993&r2=229994&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetMachine.h (original)
+++ llvm/trunk/include/llvm/Target/TargetMachine.h Fri Feb 20 01:32:59 2015
@@ -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());
   }
 

Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMAsmPrinter.h?rev=229994&r1=229993&r2=229994&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMAsmPrinter.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMAsmPrinter.h Fri Feb 20 01:32:59 2015
@@ -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;
   }
 

Modified: llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp?rev=229994&r1=229993&r2=229994&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp Fri Feb 20 01:32:59 2015
@@ -1249,7 +1249,7 @@ void PPCDarwinAsmPrinter::EmitStartOfAsm
   // 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)





More information about the llvm-commits mailing list