[llvm] r212102 - Rephrase loop so it doesn't leave unused bools around in Release mode.
Benjamin Kramer
benny.kra at googlemail.com
Tue Jul 1 07:46:44 PDT 2014
Author: d0k
Date: Tue Jul 1 09:46:44 2014
New Revision: 212102
URL: http://llvm.org/viewvc/llvm-project?rev=212102&view=rev
Log:
Rephrase loop so it doesn't leave unused bools around in Release mode.
Modified:
llvm/trunk/tools/llvm-readobj/ARMWinEHPrinter.cpp
Modified: llvm/trunk/tools/llvm-readobj/ARMWinEHPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ARMWinEHPrinter.cpp?rev=212102&r1=212101&r2=212102&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ARMWinEHPrinter.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/ARMWinEHPrinter.cpp Tue Jul 1 09:46:44 2014
@@ -508,15 +508,13 @@ void Decoder::decodeOpcodes(ArrayRef<uli
bool Terminated = false;
for (unsigned OI = Offset, OE = Opcodes.size(); !Terminated && OI < OE; ) {
- bool Decoded = false;
- for (unsigned DI = 0, DE = array_lengthof(Ring); DI < DE; ++DI) {
+ for (unsigned DI = 0;; ++DI) {
if ((Opcodes[OI] & Ring[DI].Mask) == Ring[DI].Value) {
Terminated = (this->*Ring[DI].Routine)(Opcodes.data(), OI, 0, Prologue);
- Decoded = true;
break;
}
+ assert(DI < array_lengthof(Ring) && "unhandled opcode");
}
- assert(Decoded && "unhandled opcode");
}
}
More information about the llvm-commits
mailing list