Change loops to derive the number of tables automatically

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128818 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Joerg Sonnenberger 2011-04-04 14:42:22 +00:00
parent 528a510ba1
commit db37e40723

View File

@ -267,7 +267,7 @@ static const char* stringForModifierType(ModifierType mt)
DisassemblerTables::DisassemblerTables() {
unsigned i;
for (i = 0; i < 4; i++) {
for (i = 0; i < sizeof(Tables) / sizeof(Tables[0]); i++) {
Tables[i] = new ContextDecision;
memset(Tables[i], 0, sizeof(ContextDecision));
}
@ -278,7 +278,7 @@ DisassemblerTables::DisassemblerTables() {
DisassemblerTables::~DisassemblerTables() {
unsigned i;
for (i = 0; i < 4; i++)
for (i = 0; i < sizeof(Tables) / sizeof(Tables[0]); i++)
delete Tables[i];
}