From 8ea8f377aa0b4fcde9d1187e8aae4c2b355a0623 Mon Sep 17 00:00:00 2001 From: Alexei Starovoitov Date: Mon, 2 Feb 2015 21:24:27 +0000 Subject: [PATCH] bpf: Use the getSubtarget call off of the MachineFunction rather than the TargetMachine 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227865 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/BPF/BPFISelLowering.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Target/BPF/BPFISelLowering.cpp b/lib/Target/BPF/BPFISelLowering.cpp index 543c79a9c63..64ac515fbfc 100644 --- a/lib/Target/BPF/BPFISelLowering.cpp +++ b/lib/Target/BPF/BPFISelLowering.cpp @@ -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"); -- 2.34.1