1 //===- CodeGenRegisters.h - Register and RegisterClass Info -----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // 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
18 #include "llvm/CodeGen/ValueTypes.h"
26 /// CodeGenRegister - Represents a register definition.
27 struct CodeGenRegister {
29 const std::string &getName() const;
30 unsigned DeclaredSpillSize, DeclaredSpillAlignment;
31 CodeGenRegister(Record *R);
35 struct CodeGenRegisterClass {
37 std::string Namespace;
38 std::vector<Record*> Elements;
39 std::vector<MVT::SimpleValueType> VTs;
41 unsigned SpillAlignment;
43 std::vector<Record*> SubRegClasses;
44 std::string MethodProtos, MethodBodies;
46 const std::string &getName() const;
47 const std::vector<MVT::SimpleValueType> &getValueTypes() const {return VTs;}
48 unsigned getNumValueTypes() const { return VTs.size(); }
50 MVT::SimpleValueType getValueTypeNum(unsigned VTNum) const {
51 if (VTNum < VTs.size())
53 assert(0 && "VTNum greater than number of ValueTypes in RegClass!");
57 CodeGenRegisterClass(Record *R);