bpf: Use the getSubtarget call off of the MachineFunction rather than the TargetMachine
authorAlexei Starovoitov <alexei.starovoitov@gmail.com>
Mon, 2 Feb 2015 21:24:27 +0000 (21:24 +0000)
committerAlexei Starovoitov <alexei.starovoitov@gmail.com>
Mon, 2 Feb 2015 21:24:27 +0000 (21:24 +0000)
Summary:
Hi Eric,

this patch cleans up the layering violation that you're fixing across backends.
Anything else I need to fix on bpf backend side?

Thanks

Reviewers: echristo

Reviewed By: echristo

Differential Revision: http://reviews.llvm.org/D7355

llvm-svn: 227865

llvm/lib/Target/BPF/BPFISelLowering.cpp

index 543c79a..64ac515 100644 (file)
@@ -539,8 +539,7 @@ BPFTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
                                                MachineBasicBlock *BB) const {
   unsigned Opc = MI->getOpcode();
 
-  const TargetInstrInfo &TII =
-      *getTargetMachine().getSubtargetImpl()->getInstrInfo();
+  const TargetInstrInfo &TII = *BB->getParent()->getSubtarget().getInstrInfo();
   DebugLoc DL = MI->getDebugLoc();
 
   assert(Opc == BPF::Select && "Unexpected instr type to insert");