1 //===- CodeGenRegisters.h - Register and RegisterClass Info -----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines structures to encapsulate information gleaned from the
11 // target register and register class definitions.
13 //===----------------------------------------------------------------------===//
15 #ifndef CODEGEN_REGISTERS_H
16 #define CODEGEN_REGISTERS_H
20 #include "llvm/CodeGen/ValueTypes.h"
25 /// CodeGenRegister - Represents a register definition.
26 struct CodeGenRegister {
28 const std::string &getName() const;
29 unsigned DeclaredSpillSize, DeclaredSpillAlignment;
30 CodeGenRegister(Record *R);
34 struct CodeGenRegisterClass {
36 std::string Namespace;
37 std::vector<Record*> Elements;
38 std::vector<MVT::ValueType> VTs;
40 unsigned SpillAlignment;
41 std::string MethodProtos, MethodBodies;
43 const std::string &getName() const;
45 unsigned getNumValueTypes() const { return VTs.size(); }
47 const MVT::ValueType getValueTypeNum(unsigned VTNum) const {
48 if (VTNum < VTs.size())
50 assert(0 && "VTNum greater than number of ValueTypes in RegClass!");
54 CodeGenRegisterClass(Record *R);