2004-08-16 01:09:52 +00:00
|
|
|
//===- CodeGenRegisters.h - Register and RegisterClass Info -----*- C++ -*-===//
|
2005-04-22 00:00:37 +00:00
|
|
|
//
|
2004-08-16 01:09:52 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by the LLVM research group and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
2005-04-22 00:00:37 +00:00
|
|
|
//
|
2004-08-16 01:09:52 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file defines structures to encapsulate information gleaned from the
|
|
|
|
// target register and register class definitions.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef CODEGEN_REGISTERS_H
|
|
|
|
#define CODEGEN_REGISTERS_H
|
|
|
|
|
|
|
|
#include <string>
|
2004-08-21 04:05:00 +00:00
|
|
|
#include <vector>
|
2005-09-08 21:43:21 +00:00
|
|
|
#include "llvm/CodeGen/ValueTypes.h"
|
2004-08-16 01:09:52 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class Record;
|
|
|
|
|
|
|
|
/// CodeGenRegister - Represents a register definition.
|
|
|
|
struct CodeGenRegister {
|
|
|
|
Record *TheDef;
|
|
|
|
const std::string &getName() const;
|
2004-08-21 02:24:57 +00:00
|
|
|
unsigned DeclaredSpillSize, DeclaredSpillAlignment;
|
|
|
|
CodeGenRegister(Record *R);
|
2004-08-16 01:09:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct CodeGenRegisterClass {
|
2004-08-21 04:05:00 +00:00
|
|
|
Record *TheDef;
|
2005-08-19 18:45:20 +00:00
|
|
|
std::string Namespace;
|
2004-08-21 04:05:00 +00:00
|
|
|
std::vector<Record*> Elements;
|
2005-12-01 04:51:06 +00:00
|
|
|
std::vector<MVT::ValueType> VTs;
|
2004-08-21 04:05:00 +00:00
|
|
|
unsigned SpillSize;
|
|
|
|
unsigned SpillAlignment;
|
2005-08-19 19:12:51 +00:00
|
|
|
std::string MethodProtos, MethodBodies;
|
2004-08-21 04:05:00 +00:00
|
|
|
|
|
|
|
const std::string &getName() const;
|
2005-12-30 00:12:56 +00:00
|
|
|
const std::vector<MVT::ValueType> &getValueTypes() const { return VTs; }
|
2005-12-05 02:35:08 +00:00
|
|
|
unsigned getNumValueTypes() const { return VTs.size(); }
|
|
|
|
|
2005-12-01 04:51:06 +00:00
|
|
|
const MVT::ValueType getValueTypeNum(unsigned VTNum) const {
|
|
|
|
if (VTNum < VTs.size())
|
|
|
|
return VTs[VTNum];
|
|
|
|
assert(0 && "VTNum greater than number of ValueTypes in RegClass!");
|
|
|
|
abort();
|
|
|
|
}
|
|
|
|
|
2004-08-21 04:05:00 +00:00
|
|
|
CodeGenRegisterClass(Record *R);
|
2004-08-16 01:09:52 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|