Store just the SimpleValueType in the generated VT tables for each register class, eliminating static ctors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150173 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2012-02-09 12:35:37 +00:00
parent 133f9d9894
commit 2c6ae095b8
2 changed files with 5 additions and 4 deletions

View File

@ -36,7 +36,7 @@ class TargetRegisterClass {
public:
typedef const unsigned* iterator;
typedef const unsigned* const_iterator;
typedef const EVT* vt_iterator;
typedef const MVT::SimpleValueType* vt_iterator;
typedef const TargetRegisterClass* const * sc_iterator;
private:
virtual void anchor();
@ -46,7 +46,8 @@ private:
const sc_iterator SuperClasses;
const sc_iterator SuperRegClasses;
public:
TargetRegisterClass(const MCRegisterClass *MC, const EVT *vts,
TargetRegisterClass(const MCRegisterClass *MC,
const MVT::SimpleValueType *vts,
const unsigned *subcm,
const TargetRegisterClass * const *supcs,
const TargetRegisterClass * const *superregcs)
@ -110,7 +111,7 @@ public:
///
bool hasType(EVT vt) const {
for(int i = 0; VTs[i] != MVT::Other; ++i)
if (VTs[i] == vt)
if (EVT(VTs[i]) == vt)
return true;
return false;
}

View File

@ -521,7 +521,7 @@ RegisterInfoEmitter::runTargetDesc(raw_ostream &OS, CodeGenTarget &Target,
// Emit the register list now.
OS << " // " << Name
<< " Register Class Value Types...\n"
<< " static const EVT " << Name
<< " static const MVT::SimpleValueType " << Name
<< "[] = {\n ";
for (unsigned i = 0, e = RC.VTs.size(); i != e; ++i)
OS << getEnumName(RC.VTs[i]) << ", ";