diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-09-24 12:30:07 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-09-24 12:30:07 +0000 |
commit | cc972981d4222c6fd926bf7b0a2688dfb55a24b8 (patch) | |
tree | 2f04d44f11644220f1210d501227b9dfc8ce38a5 /llvm/lib/IR/IntrinsicInst.cpp | |
parent | 544c8f48c86cee7c8de5ed5dce99849a8ac72118 (diff) | |
download | bcm5719-llvm-cc972981d4222c6fd926bf7b0a2688dfb55a24b8.tar.gz bcm5719-llvm-cc972981d4222c6fd926bf7b0a2688dfb55a24b8.zip |
Fix cppcheck "reduce variable scope" warning. NFCI.
llvm-svn: 372742
Diffstat (limited to 'llvm/lib/IR/IntrinsicInst.cpp')
-rw-r--r-- | llvm/lib/IR/IntrinsicInst.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/IR/IntrinsicInst.cpp b/llvm/lib/IR/IntrinsicInst.cpp index 2996cfb5332..d3c948d6de3 100644 --- a/llvm/lib/IR/IntrinsicInst.cpp +++ b/llvm/lib/IR/IntrinsicInst.cpp @@ -67,13 +67,12 @@ int llvm::Intrinsic::lookupLLVMIntrinsicByName(ArrayRef<const char *> NameTable, // size 1. During the search, we can skip the prefix that we already know is // identical. By using strncmp we consider names with differing suffixes to // be part of the equal range. - size_t CmpStart = 0; size_t CmpEnd = 4; // Skip the "llvm" component. const char *const *Low = NameTable.begin(); const char *const *High = NameTable.end(); const char *const *LastLow = Low; while (CmpEnd < Name.size() && High - Low > 0) { - CmpStart = CmpEnd; + size_t CmpStart = CmpEnd; CmpEnd = Name.find('.', CmpStart + 1); CmpEnd = CmpEnd == StringRef::npos ? Name.size() : CmpEnd; auto Cmp = [CmpStart, CmpEnd](const char *LHS, const char *RHS) { |