summaryrefslogtreecommitdiff
path: root/lib/Transforms/InstCombine
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2013-07-15 04:27:47 +0000
committerCraig Topper <craig.topper@gmail.com>2013-07-15 04:27:47 +0000
commitb9df53a40b22c74ce3f3a7b4a7c0676a38cf5e73 (patch)
tree379b31d1b5945030b21c8fb5be73e9d4df5cfe45 /lib/Transforms/InstCombine
parentd8fdb628ea86001e64bec1bbee8bbfa7982cf80c (diff)
downloadllvm-b9df53a40b22c74ce3f3a7b4a7c0676a38cf5e73.tar.gz
llvm-b9df53a40b22c74ce3f3a7b4a7c0676a38cf5e73.tar.bz2
llvm-b9df53a40b22c74ce3f3a7b4a7c0676a38cf5e73.tar.xz
Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186301 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine')
-rw-r--r--lib/Transforms/InstCombine/InstCombineAddSub.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineAddSub.cpp b/lib/Transforms/InstCombine/InstCombineAddSub.cpp
index 03fd35fb81..686978ac98 100644
--- a/lib/Transforms/InstCombine/InstCombineAddSub.cpp
+++ b/lib/Transforms/InstCombine/InstCombineAddSub.cpp
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "InstCombine.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
@@ -659,7 +660,7 @@ Value *FAddCombine::simplifyFAdd(AddendVect& Addends, unsigned InstrQuota) {
}
}
- assert((NextTmpIdx <= sizeof(TmpResult)/sizeof(TmpResult[0]) + 1) &&
+ assert((NextTmpIdx <= array_lengthof(TmpResult) + 1) &&
"out-of-bound access");
if (ConstAdd)