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