[llvm] 58236e6 - Reduce scope of variable to silence cppcheck warning. NFC
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 9 14:16:47 PST 2019
Author: Simon Pilgrim
Date: 2019-11-09T22:10:09Z
New Revision: 58236e6fa6c4338ae91e61028a416d592bb908b8
URL: https://github.com/llvm/llvm-project/commit/58236e6fa6c4338ae91e61028a416d592bb908b8
DIFF: https://github.com/llvm/llvm-project/commit/58236e6fa6c4338ae91e61028a416d592bb908b8.diff
LOG: Reduce scope of variable to silence cppcheck warning. NFC
Added:
Modified:
llvm/utils/TableGen/FixedLenDecoderEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp b/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp
index ac69b431607d..21ec5897ea50 100644
--- a/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp
+++ b/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp
@@ -1058,10 +1058,9 @@ unsigned FilterChooser::getIslands(std::vector<unsigned> &StartBits,
// 1: Water (the bit value does not affect decoding)
// 2: Island (well-known bit value needed for decoding)
int State = 0;
- int64_t Val = -1;
for (unsigned i = 0; i < BitWidth; ++i) {
- Val = Value(Insn[i]);
+ int64_t Val = Value(Insn[i]);
bool Filtered = PositionFiltered(i);
switch (State) {
default: llvm_unreachable("Unreachable code!");
More information about the llvm-commits
mailing list