[llvm-commits] [llvm] r128818 - /llvm/trunk/utils/TableGen/X86DisassemblerTables.cpp
Joerg Sonnenberger
joerg at bec.de
Mon Apr 4 07:42:22 PDT 2011
Author: joerg
Date: Mon Apr 4 09:42:22 2011
New Revision: 128818
URL: http://llvm.org/viewvc/llvm-project?rev=128818&view=rev
Log:
Change loops to derive the number of tables automatically
Modified:
llvm/trunk/utils/TableGen/X86DisassemblerTables.cpp
Modified: llvm/trunk/utils/TableGen/X86DisassemblerTables.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/X86DisassemblerTables.cpp?rev=128818&r1=128817&r2=128818&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/X86DisassemblerTables.cpp (original)
+++ llvm/trunk/utils/TableGen/X86DisassemblerTables.cpp Mon Apr 4 09:42:22 2011
@@ -267,7 +267,7 @@
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() {
unsigned i;
- for (i = 0; i < 4; i++)
+ for (i = 0; i < sizeof(Tables) / sizeof(Tables[0]); i++)
delete Tables[i];
}
More information about the llvm-commits
mailing list