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
This commit is contained in:
Eric Christopher 2015-02-20 07:32:59 +00:00
parent a074de6ff4
commit c9d0715997
3 changed files with 3 additions and 3 deletions

View 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());
}

View 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;
}

View 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)