1 //===- DAGISelEmitter.h - Generate an instruction selector ------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This tablegen backend emits a DAG instruction selector.
12 //===----------------------------------------------------------------------===//
14 #ifndef DAGISEL_EMITTER_H
15 #define DAGISEL_EMITTER_H
17 #include "CodeGenDAGPatterns.h"
22 /// DAGISelEmitter - The top-level class which coordinates construction
23 /// and emission of the instruction selector.
25 class DAGISelEmitter : public TableGenBackend {
26 RecordKeeper &Records;
27 CodegenDAGPatterns *CGP;
29 DAGISelEmitter(RecordKeeper &R) : Records(R) {}
31 // run - Output the isel, returning true on failure.
32 void run(std::ostream &OS);
36 void GenerateCodeForPattern(const PatternToMatch &Pattern,
37 std::vector<std::pair<unsigned, std::string> > &GeneratedCode,
38 std::set<std::string> &GeneratedDecl,
39 std::vector<std::string> &TargetOpcodes,
40 std::vector<std::string> &TargetVTs);
41 void EmitPatterns(std::vector<std::pair<const PatternToMatch*,
42 std::vector<std::pair<unsigned, std::string> > > > &Patterns,
43 unsigned Indent, std::ostream &OS);
44 void EmitInstructionSelector(std::ostream &OS);
47 } // End llvm namespace