LLVM  3.7.0
MipsModuleISelDAGToDAG.cpp
Go to the documentation of this file.
1 //===----------------------------------------------------------------------===//
2 // Instruction Selector Subtarget Control
3 //===----------------------------------------------------------------------===//
4 
5 //===----------------------------------------------------------------------===//
6 // This file defines a pass used to change the subtarget for the
7 // Mips Instruction selector.
8 //
9 //===----------------------------------------------------------------------===//
10 
11 #include "Mips.h"
12 #include "MipsTargetMachine.h"
13 #include "llvm/Support/Debug.h"
15 
16 using namespace llvm;
17 
18 #define DEBUG_TYPE "mips-isel"
19 
20 namespace {
21  class MipsModuleDAGToDAGISel : public MachineFunctionPass {
22  public:
23  static char ID;
24 
25  explicit MipsModuleDAGToDAGISel(MipsTargetMachine &TM_)
26  : MachineFunctionPass(ID), TM(TM_) {}
27 
28  // Pass Name
29  const char *getPassName() const override {
30  return "MIPS DAG->DAG Pattern Instruction Selection";
31  }
32 
33  bool runOnMachineFunction(MachineFunction &MF) override;
34 
35  protected:
37  };
38 
40 }
41 
42 bool MipsModuleDAGToDAGISel::runOnMachineFunction(MachineFunction &MF) {
43  DEBUG(errs() << "In MipsModuleDAGToDAGISel::runMachineFunction\n");
44  TM.resetSubtarget(&MF);
45  return false;
46 }
47 
49  return new MipsModuleDAGToDAGISel(TM);
50 }
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:294
FunctionPass * createMipsModuleISelDagPass(MipsTargetMachine &TM)
#define DEBUG(X)
Definition: Debug.h:92