Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).

llvm-svn: 186302
This commit is contained in:
Craig Topper 2013-07-15 04:28:48 +00:00
parent 5871321e49
commit 93b402d924
1 changed files with 2 additions and 1 deletions

View File

@ -25,6 +25,7 @@
#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/OptTable.h"
#include "llvm/Option/Option.h"
@ -302,7 +303,7 @@ static void ParseProgName(SmallVectorImpl<const char *> &ArgVector,
bool FoundMatch = false;
size_t i;
for (i = 0; i < sizeof(suffixes) / sizeof(suffixes[0]); ++i) {
for (i = 0; i < llvm::array_lengthof(suffixes); ++i) {
if (ProgNameRef.endswith(suffixes[i].Suffix)) {
FoundMatch = true;
if (suffixes[i].IsCXX)