blob: 7e2a7cb0a3742cb381bc15f2457e3120ff646bce [file] [log] [blame]
Jim Laskey4bb9cbb2005-10-21 19:00:04 +00001//===- SubtargetEmitter.h - Generate subtarget enumerations -----*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by James M. Laskey and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This tablegen backend emits subtarget enumerations.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef SUBTARGET_EMITTER_H
15#define SUBTARGET_EMITTER_H
16
17#include "TableGenBackend.h"
18
19namespace llvm {
20
21class SubtargetEmitter : public TableGenBackend {
22 RecordKeeper &Records;
Jim Laskey581a8f72005-10-26 17:30:34 +000023 std::string Target;
Jim Laskeyb3b1d5f2005-10-25 15:16:36 +000024
Jim Laskey581a8f72005-10-26 17:30:34 +000025 void Enumeration(std::ostream &OS, const char *ClassName, bool isBits);
Jim Laskeyb3b1d5f2005-10-25 15:16:36 +000026 void FeatureKeyValues(std::ostream &OS);
27 void CPUKeyValues(std::ostream &OS);
Jim Laskey581a8f72005-10-26 17:30:34 +000028 void SubtargetEmitter::ParseFeaturesFunction(std::ostream &OS);
Jim Laskeyb3b1d5f2005-10-25 15:16:36 +000029
Jim Laskey4bb9cbb2005-10-21 19:00:04 +000030public:
31 SubtargetEmitter(RecordKeeper &R) : Records(R) {}
32
33 // run - Output the subtarget enumerations, returning true on failure.
34 void run(std::ostream &o);
35
36};
37
38
39} // End llvm namespace
40
41#endif
42
43
44