]> granicus.if.org Git - llvm/commitdiff
MC: Fix dumping of MCFragment values
authorSam Clegg <sbc@chromium.org>
Thu, 22 Jun 2017 17:57:01 +0000 (17:57 +0000)
committerSam Clegg <sbc@chromium.org>
Thu, 22 Jun 2017 17:57:01 +0000 (17:57 +0000)
Without this cast the "char" overload of operator<< is
chosen and the values is output as an ascii rather than
an integer.

Differential Revision: https://reviews.llvm.org/D34486

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306039 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCFragment.cpp

index a7b505b68a09fc223aa65ad04b25dfb967861f13..ba08d13f81096957ae782a361e61ff246225d6dc 100644 (file)
@@ -382,7 +382,8 @@ LLVM_DUMP_METHOD void MCFragment::dump() const {
   }
   case MCFragment::FT_Fill:  {
     const MCFillFragment *FF = cast<MCFillFragment>(this);
-    OS << " Value:" << FF->getValue() << " Size:" << FF->getSize();
+    OS << " Value:" << static_cast<unsigned>(FF->getValue())
+       << " Size:" << FF->getSize();
     break;
   }
   case MCFragment::FT_Relaxable:  {
@@ -395,7 +396,8 @@ LLVM_DUMP_METHOD void MCFragment::dump() const {
   case MCFragment::FT_Org:  {
     const MCOrgFragment *OF = cast<MCOrgFragment>(this);
     OS << "\n       ";
-    OS << " Offset:" << OF->getOffset() << " Value:" << OF->getValue();
+    OS << " Offset:" << OF->getOffset()
+       << " Value:" << static_cast<unsigned>(OF->getValue());
     break;
   }
   case MCFragment::FT_Dwarf:  {