[llvm-branch-commits] [llvm-branch] r116937 - /llvm/branches/ggreif/peephole-infrastructure/include/llvm/Target/TargetInstrInfo.h

Gabor Greif ggreif at gmail.com
Wed Oct 20 10:46:14 PDT 2010


Author: ggreif
Date: Wed Oct 20 12:46:13 2010
New Revision: 116937

URL: http://llvm.org/viewvc/llvm-project?rev=116937&view=rev
Log:
separate out private stuff

Modified:
    llvm/branches/ggreif/peephole-infrastructure/include/llvm/Target/TargetInstrInfo.h

Modified: llvm/branches/ggreif/peephole-infrastructure/include/llvm/Target/TargetInstrInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/peephole-infrastructure/include/llvm/Target/TargetInstrInfo.h?rev=116937&r1=116936&r2=116937&view=diff
==============================================================================
--- llvm/branches/ggreif/peephole-infrastructure/include/llvm/Target/TargetInstrInfo.h (original)
+++ llvm/branches/ggreif/peephole-infrastructure/include/llvm/Target/TargetInstrInfo.h Wed Oct 20 12:46:13 2010
@@ -62,9 +62,11 @@
   typedef bool (*DispatchFun)(const CmpOpportunity&, MachineInstr *CmpInstr,
                               MachineInstr *MI, const MachineRegisterInfo &MRI,
                               MachineBasicBlock::iterator &MII);
-  DispatchFun Dispatch;
   unsigned SrcReg;
   CmpOpportunity(unsigned SrcReg) : SrcReg(SrcReg) {}
+
+  DispatchFun Dispatch;
+
   template <class SUB, bool (SUB::*FUN)(MachineInstr*, MachineInstr*,
                                         const MachineRegisterInfo&,
                                         MachineBasicBlock::iterator&) const>
@@ -72,6 +74,13 @@
     Dispatch = &dispatch<SUB, FUN>;
   }
 
+  template <bool (*FUN)(MachineInstr*, MachineInstr*,
+                        MachineBasicBlock::iterator&)>
+  void optimizeWith() {
+    Dispatch = &dispatch2<FUN>;
+  }
+
+private:
   template <class SUB, bool (SUB::*FUN)(MachineInstr*, MachineInstr*,
                                         const MachineRegisterInfo&,
                                         MachineBasicBlock::iterator&) const>
@@ -83,12 +92,6 @@
 
   template <bool (*FUN)(MachineInstr*, MachineInstr*,
                         MachineBasicBlock::iterator&)>
-  void optimizeWith() {
-    Dispatch = &dispatch2<FUN>;
-  }
-
-  template <bool (*FUN)(MachineInstr*, MachineInstr*,
-                        MachineBasicBlock::iterator&)>
   static bool dispatch2(const CmpOpportunity& self, MachineInstr *CmpInstr,
                         MachineInstr *MI, const MachineRegisterInfo &MRI,
                         MachineBasicBlock::iterator &MII) {





More information about the llvm-branch-commits mailing list