2003-10-05 21:27:59 +02:00
|
|
|
//===- RegisterInfoEmitter.h - Generate a Register File Desc. ---*- C++ -*-===//
|
2005-04-22 02:00:37 +02:00
|
|
|
//
|
2003-10-20 22:20:30 +02:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 21:37:13 +01:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-22 02:00:37 +02:00
|
|
|
//
|
2003-10-20 22:20:30 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
2003-10-05 21:27:59 +02:00
|
|
|
//
|
|
|
|
// This tablegen backend is responsible for emitting a description of a target
|
|
|
|
// register file for a code generator. It uses instances of the Register,
|
|
|
|
// RegisterAliases, and RegisterClass classes to gather this information.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef REGISTER_INFO_EMITTER_H
|
|
|
|
#define REGISTER_INFO_EMITTER_H
|
|
|
|
|
2011-10-01 18:41:13 +02:00
|
|
|
#include "llvm/TableGen/TableGenBackend.h"
|
2011-07-18 22:57:22 +02:00
|
|
|
#include <vector>
|
2003-10-05 21:27:59 +02:00
|
|
|
|
2003-11-11 23:41:34 +01:00
|
|
|
namespace llvm {
|
|
|
|
|
2011-06-27 20:32:37 +02:00
|
|
|
class CodeGenRegBank;
|
2011-07-18 22:57:22 +02:00
|
|
|
struct CodeGenRegister;
|
2011-06-27 20:32:37 +02:00
|
|
|
class CodeGenTarget;
|
|
|
|
|
2003-10-05 21:27:59 +02:00
|
|
|
class RegisterInfoEmitter : public TableGenBackend {
|
|
|
|
RecordKeeper &Records;
|
|
|
|
public:
|
|
|
|
RegisterInfoEmitter(RecordKeeper &R) : Records(R) {}
|
2005-04-22 02:00:37 +02:00
|
|
|
|
2011-06-27 20:32:37 +02:00
|
|
|
// runEnums - Print out enum values for all of the registers.
|
|
|
|
void runEnums(raw_ostream &o, CodeGenTarget &Target, CodeGenRegBank &Bank);
|
2003-10-05 21:27:59 +02:00
|
|
|
|
2011-06-27 20:32:37 +02:00
|
|
|
// runMCDesc - Print out MC register descriptions.
|
|
|
|
void runMCDesc(raw_ostream &o, CodeGenTarget &Target, CodeGenRegBank &Bank);
|
|
|
|
|
2011-06-27 21:24:13 +02:00
|
|
|
// runTargetHeader - Emit a header fragment for the register info emitter.
|
|
|
|
void runTargetHeader(raw_ostream &o, CodeGenTarget &Target,
|
|
|
|
CodeGenRegBank &Bank);
|
|
|
|
|
2011-06-27 20:32:37 +02:00
|
|
|
// runTargetDesc - Output the target register and register file descriptions.
|
2011-06-27 21:24:13 +02:00
|
|
|
void runTargetDesc(raw_ostream &o, CodeGenTarget &Target,
|
|
|
|
CodeGenRegBank &Bank);
|
2011-06-24 03:44:41 +02:00
|
|
|
|
2011-06-27 20:32:37 +02:00
|
|
|
// run - Output the register file description.
|
|
|
|
void run(raw_ostream &o);
|
2011-07-18 22:57:22 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
void EmitRegMapping(raw_ostream &o,
|
|
|
|
const std::vector<CodeGenRegister*> &Regs, bool isCtor);
|
2011-07-22 02:44:39 +02:00
|
|
|
void EmitRegClasses(raw_ostream &OS, CodeGenTarget &Target);
|
2003-10-05 21:27:59 +02:00
|
|
|
};
|
|
|
|
|
2003-11-11 23:41:34 +01:00
|
|
|
} // End llvm namespace
|
|
|
|
|
2003-10-05 21:27:59 +02:00
|
|
|
#endif
|