//===- SubtargetEmitter.cpp - Generate subtarget enumerations -------------===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This tablegen backend emits subtarget enumerations.////===----------------------------------------------------------------------===//#define DEBUG_TYPE "subtarget-emitter"#include"CodeGenTarget.h"#include"CodeGenSchedule.h"#include"llvm/ADT/STLExtras.h"#include"llvm/ADT/StringExtras.h"#include"llvm/MC/MCInstrItineraries.h"#include"llvm/Support/Debug.h"#include"llvm/Support/Format.h"#include"llvm/TableGen/Error.h"#include"llvm/TableGen/Record.h"#include"llvm/TableGen/TableGenBackend.h"#include<algorithm>#include<map>#include<string>#include<vector>usingnamespacellvm;namespace{classSubtargetEmitter{// Each processor has a SchedClassDesc table with an entry for each SchedClass.// The SchedClassDesc table indexes into a global write resource table, write// latency table, and read advance table.structSchedClassTables{std::vector<std::vector<MCSchedClassDesc>>ProcSchedClasses;std::vector<MCWriteProcResEntry>WriteProcResources;std::vector<MCWriteLatencyEntry>WriteLatencies;std::vector<std::string>WriterNames;std::vector<MCReadAdvanceEntry>ReadAdvanceEntries;// Reserve an invalid entry at index 0SchedClassTables()