Use array_lengthof

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128823 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Joerg Sonnenberger 2011-04-04 16:25:38 +00:00
parent 229e4523f2
commit 39d7caea69

View File

@ -18,6 +18,7 @@
#include "X86DisassemblerTables.h"
#include "TableGenBackend.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Format.h"
@ -267,7 +268,7 @@ static const char* stringForModifierType(ModifierType mt)
DisassemblerTables::DisassemblerTables() {
unsigned i;
for (i = 0; i < sizeof(Tables) / sizeof(Tables[0]); i++) {
for (i = 0; i < array_lengthof(Tables); i++) {
Tables[i] = new ContextDecision;
memset(Tables[i], 0, sizeof(ContextDecision));
}
@ -278,7 +279,7 @@ DisassemblerTables::DisassemblerTables() {
DisassemblerTables::~DisassemblerTables() {
unsigned i;
for (i = 0; i < sizeof(Tables) / sizeof(Tables[0]); i++)
for (i = 0; i < array_lengthof(Tables); i++)
delete Tables[i];
}