aboutsummaryrefslogtreecommitdiff
path: root/utils/TableGen/X86DisassemblerTables.cpp
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2011-04-04 14:42:22 +0000
committerJoerg Sonnenberger <joerg@bec.de>2011-04-04 14:42:22 +0000
commitdb37e4072361bc44f2c0661cb1add90e74012b13 (patch)
tree651937403ee1b4a35779c96a2b4bc6664119d462 /utils/TableGen/X86DisassemblerTables.cpp
parent528a510ba1eed791b6dcf270b080175b8a3f0d20 (diff)
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
Diffstat (limited to 'utils/TableGen/X86DisassemblerTables.cpp')
-rw-r--r--utils/TableGen/X86DisassemblerTables.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/TableGen/X86DisassemblerTables.cpp b/utils/TableGen/X86DisassemblerTables.cpp
index 081b5771cd..66f1fab054 100644
--- a/utils/TableGen/X86DisassemblerTables.cpp
+++ b/utils/TableGen/X86DisassemblerTables.cpp
@@ -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];
}