Silencing an MSVC C4334 warning ('<<' : result of 32-bit shift implicitly converted...
[oota-llvm.git] / tools / llvm-readobj / ARMWinEHPrinter.cpp
index 7138438ca229f5415046f5bf353e7ec41a3f12d5..b486e4ad0e51a1dfdcf0e60c40db5a1178d6c912 100644 (file)
@@ -95,7 +95,8 @@ raw_ostream &operator<<(raw_ostream &OS, const ARM::WinEH::ReturnType &RT) {
 
 static std::string formatSymbol(StringRef Name, uint64_t Address,
                                 uint64_t Offset = 0) {
-  string_ostream OS;
+  std::string Buffer;
+  raw_string_ostream OS(Buffer);
 
   if (!Name.empty())
     OS << Name << " ";
@@ -507,15 +508,13 @@ void Decoder::decodeOpcodes(ArrayRef<ulittle8_t> Opcodes, unsigned Offset,
 
   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");
   }
 }