[llvm] r227865 - bpf: Use the getSubtarget call off of the MachineFunction rather than the TargetMachine

Alexei Starovoitov alexei.starovoitov at gmail.com
Mon Feb 2 13:24:27 PST 2015


Author: ast
Date: Mon Feb  2 15:24:27 2015
New Revision: 227865

URL: http://llvm.org/viewvc/llvm-project?rev=227865&view=rev
Log:
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

Modified:
    llvm/trunk/lib/Target/BPF/BPFISelLowering.cpp

Modified: llvm/trunk/lib/Target/BPF/BPFISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/BPF/BPFISelLowering.cpp?rev=227865&r1=227864&r2=227865&view=diff
==============================================================================
--- llvm/trunk/lib/Target/BPF/BPFISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/BPF/BPFISelLowering.cpp Mon Feb  2 15:24:27 2015
@@ -539,8 +539,7 @@ BPFTargetLowering::EmitInstrWithCustomIn
                                                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");





More information about the llvm-commits mailing list