diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-09-30 22:18:45 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-09-30 22:18:45 +0000 |
commit | f9a4bb78dadc12c7c1e604c6f17b63a71305c2ca (patch) | |
tree | 5289fcfc5dbaf901973b52d4e320ffb6f807bac9 /utils/TableGen/CodeGenRegisters.h | |
parent | f391e9f696183a8dfb6b0d1e791687a520552f85 (diff) | |
download | llvm-f9a4bb78dadc12c7c1e604c6f17b63a71305c2ca.tar.gz llvm-f9a4bb78dadc12c7c1e604c6f17b63a71305c2ca.tar.bz2 llvm-f9a4bb78dadc12c7c1e604c6f17b63a71305c2ca.tar.xz |
Compute lists of super-classes in CodeGenRegisterClass.
Use these lists instead of computing them on the fly in
RegisterInfoEmitter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140895 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/CodeGenRegisters.h')
-rw-r--r-- | utils/TableGen/CodeGenRegisters.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/utils/TableGen/CodeGenRegisters.h b/utils/TableGen/CodeGenRegisters.h index ae8f0d4abd..74cf4127a3 100644 --- a/utils/TableGen/CodeGenRegisters.h +++ b/utils/TableGen/CodeGenRegisters.h @@ -90,6 +90,9 @@ namespace llvm { std::vector<SmallVector<Record*, 16> > AltOrders; // Bit mask of sub-classes including this, indexed by their EnumValue. BitVector SubClasses; + // List of super-classes, topologocally ordered to have the larger classes + // first. This is the same as sorting by EnumValue. + SmallVector<CodeGenRegisterClass*, 4> SuperClasses; public: Record *TheDef; unsigned EnumValue; @@ -128,6 +131,17 @@ namespace llvm { // bool hasSubClass(const CodeGenRegisterClass *RC) const; + // getSubClasses - Returns a constant BitVector of subclasses indexed by + // EnumValue. + // The SubClasses vector includs an entry for this class. + const BitVector &getSubClasses() const { return SubClasses; }; + + // getSuperClasses - Returns a list of super classes ordered by EnumValue. + // The array does not include an entry for this class. + ArrayRef<CodeGenRegisterClass*> getSuperClasses() const { + return SuperClasses; + } + // Returns an ordered list of class members. // The order of registers is the same as in the .td file. // No = 0 is the default allocation order, No = 1 is the first alternative. |