Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 1 | //===- DAGISelEmitter.h - Generate an instruction selector ------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | fd6c2f0 | 2007-12-29 20:37:13 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This tablegen backend emits a DAG instruction selector. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef DAGISEL_EMITTER_H |
| 15 | #define DAGISEL_EMITTER_H |
| 16 | |
Dan Gohman | 907df57 | 2008-04-03 00:02:49 +0000 | [diff] [blame] | 17 | #include "TableGenBackend.h" |
Chris Lattner | 4ca8ff0 | 2008-01-05 22:25:12 +0000 | [diff] [blame] | 18 | #include "CodeGenDAGPatterns.h" |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 19 | #include <set> |
| 20 | |
| 21 | namespace llvm { |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 22 | |
| 23 | /// DAGISelEmitter - The top-level class which coordinates construction |
| 24 | /// and emission of the instruction selector. |
| 25 | /// |
| 26 | class DAGISelEmitter : public TableGenBackend { |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 27 | RecordKeeper &Records; |
Chris Lattner | ae50670 | 2008-01-06 01:10:31 +0000 | [diff] [blame] | 28 | CodeGenDAGPatterns CGP; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 29 | public: |
Dan Gohman | edd345c | 2009-02-18 16:37:45 +0000 | [diff] [blame] | 30 | explicit DAGISelEmitter(RecordKeeper &R) : Records(R), CGP(R) {} |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 31 | |
| 32 | // run - Output the isel, returning true on failure. |
Daniel Dunbar | d428706 | 2009-07-03 00:10:29 +0000 | [diff] [blame] | 33 | void run(raw_ostream &OS); |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 34 | private: |
Daniel Dunbar | d428706 | 2009-07-03 00:10:29 +0000 | [diff] [blame] | 35 | void EmitPredicateFunctions(raw_ostream &OS); |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | } // End llvm namespace |
| 39 | |
| 40 | #endif |