Start parsing register classes into a more structured form
[oota-llvm.git] / utils / TableGen / CodeGenRegisters.h
1 //===- CodeGenRegisters.h - Register and RegisterClass Info -----*- C++ -*-===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
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.
7 // 
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines structures to encapsulate information gleaned from the
11 // target register and register class definitions.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef CODEGEN_REGISTERS_H
16 #define CODEGEN_REGISTERS_H
17
18 #include <string>
19 #include <vector>
20
21 namespace llvm {
22   class Record;
23
24   /// CodeGenRegister - Represents a register definition.
25   struct CodeGenRegister {
26     Record *TheDef;
27     const std::string &getName() const;
28     unsigned DeclaredSpillSize, DeclaredSpillAlignment;
29     
30     CodeGenRegister(Record *R);
31   };
32
33
34   struct CodeGenRegisterClass {
35     Record *TheDef;
36     std::vector<Record*> Elements;
37     unsigned SpillSize;
38     unsigned SpillAlignment;
39
40     const std::string &getName() const;
41
42     CodeGenRegisterClass(Record *R);
43   };
44 }
45
46 #endif