summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/CodeGenTarget.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-06-10 18:40:00 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-06-10 18:40:00 +0000
commit76a5a71ec33b75a935cdf0efca970ef1b9ba0abd (patch)
tree98a1a75bee0433b49b8a3ead487c6cd779492b5a /llvm/utils/TableGen/CodeGenTarget.h
parent54ce7a5671c0fb400b0d1eda5c62797c83be8104 (diff)
downloadbcm5719-llvm-76a5a71ec33b75a935cdf0efca970ef1b9ba0abd.tar.gz
bcm5719-llvm-76a5a71ec33b75a935cdf0efca970ef1b9ba0abd.zip
Move some sub-register index calculations to CodeGenRegisters.cpp
Create a new CodeGenRegBank class that will eventually hold all the code that computes the register structure from Records. llvm-svn: 132849
Diffstat (limited to 'llvm/utils/TableGen/CodeGenTarget.h')
-rw-r--r--llvm/utils/TableGen/CodeGenTarget.h23
1 files changed, 4 insertions, 19 deletions
diff --git a/llvm/utils/TableGen/CodeGenTarget.h b/llvm/utils/TableGen/CodeGenTarget.h
index 891b2d524c7..86050fb7fa9 100644
--- a/llvm/utils/TableGen/CodeGenTarget.h
+++ b/llvm/utils/TableGen/CodeGenTarget.h
@@ -65,12 +65,11 @@ class CodeGenTarget {
Record *TargetRec;
mutable DenseMap<const Record*, CodeGenInstruction*> Instructions;
+ mutable CodeGenRegBank *RegBank;
mutable std::vector<CodeGenRegister> Registers;
- mutable std::vector<Record*> SubRegIndices;
mutable std::vector<CodeGenRegisterClass> RegisterClasses;
mutable std::vector<MVT::SimpleValueType> LegalValueTypes;
void ReadRegisters() const;
- void ReadSubRegIndices() const;
void ReadRegisterClasses() const;
void ReadInstructions() const;
void ReadLegalValueTypes() const;
@@ -98,6 +97,9 @@ public:
///
Record *getAsmWriter() const;
+ /// getRegBank - Return the register bank description.
+ CodeGenRegBank &getRegBank() const;
+
const std::vector<CodeGenRegister> &getRegisters() const {
if (Registers.empty()) ReadRegisters();
return Registers;
@@ -107,23 +109,6 @@ public:
/// return it.
const CodeGenRegister *getRegisterByName(StringRef Name) const;
- const std::vector<Record*> &getSubRegIndices() const {
- if (SubRegIndices.empty()) ReadSubRegIndices();
- return SubRegIndices;
- }
-
- // Map a SubRegIndex Record to its number.
- unsigned getSubRegIndexNo(Record *idx) const {
- if (SubRegIndices.empty()) ReadSubRegIndices();
- std::vector<Record*>::const_iterator i =
- std::find(SubRegIndices.begin(), SubRegIndices.end(), idx);
- assert(i != SubRegIndices.end() && "Not a SubRegIndex");
- return (i - SubRegIndices.begin()) + 1;
- }
-
- // Create a new SubRegIndex with the given name.
- Record *createSubRegIndex(const std::string &Name);
-
const std::vector<CodeGenRegisterClass> &getRegisterClasses() const {
if (RegisterClasses.empty()) ReadRegisterClasses();
return RegisterClasses;
OpenPOWER on IntegriCloud