UnXFAIL this test.
[llvm-complete.git] / utils / TableGen / SubtargetEmitter.h
blob4fcd8f8b0b24be5a539b0a48820a4bb5cf2902fb
1 //===- SubtargetEmitter.h - Generate subtarget enumerations -----*- 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 subtarget enumerations.
12 //===----------------------------------------------------------------------===//
14 #ifndef SUBTARGET_EMITTER_H
15 #define SUBTARGET_EMITTER_H
17 #include "TableGenBackend.h"
18 #include "llvm/Target/TargetInstrItineraries.h"
19 #include <vector>
20 #include <map>
21 #include <string>
24 namespace llvm {
26 class SubtargetEmitter : public TableGenBackend {
28 RecordKeeper &Records;
29 std::string Target;
30 bool HasItineraries;
32 void Enumeration(std::ostream &OS, const char *ClassName, bool isBits);
33 void FeatureKeyValues(std::ostream &OS);
34 void CPUKeyValues(std::ostream &OS);
35 unsigned CollectAllItinClasses(std::ostream &OS,
36 std::map<std::string, unsigned> &ItinClassesMap);
37 void FormItineraryString(Record *ItinData, std::string &ItinString,
38 unsigned &NStages);
39 void EmitStageData(std::ostream &OS, unsigned NItinClasses,
40 std::map<std::string, unsigned> &ItinClassesMap,
41 std::vector<std::vector<InstrItinerary> > &ProcList);
42 void EmitProcessorData(std::ostream &OS,
43 std::vector<std::vector<InstrItinerary> > &ProcList);
44 void EmitProcessorLookup(std::ostream &OS);
45 void EmitData(std::ostream &OS);
46 void ParseFeaturesFunction(std::ostream &OS);
48 public:
49 SubtargetEmitter(RecordKeeper &R) : Records(R), HasItineraries(false) {}
51 // run - Output the subtarget enumerations, returning true on failure.
52 void run(std::ostream &o);
57 } // End llvm namespace
59 #endif