aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgii Rymar <grimar@accesssoftek.com>2020-11-18 11:55:03 +0300
committerGeorgii Rymar <grimar@accesssoftek.com>2020-11-18 11:55:03 +0300
commitfc40a03323a4b265ccbed34a07e281b13c5e8367 (patch)
tree567d0d610c60f3118eba412907a40cf4b002023b /llvm/lib/Support/YAMLTraits.cpp
parentSpeculativeExecution: Allow speculating more instruction types (diff)
downloadllvm-project-fc40a03323a4b265ccbed34a07e281b13c5e8367.tar.gz
llvm-project-fc40a03323a4b265ccbed34a07e281b13c5e8367.tar.bz2
llvm-project-fc40a03323a4b265ccbed34a07e281b13c5e8367.zip
Revert "[lib/Support/YAMLTraits] - Don't print leading zeroes when dumping Hex8/Hex16/Hex32 types."
This reverts commit 65fd17c241e22e1671e81efdb683687369c2feb3. It breaks LLD/MachO tests that seems use obj2yaml the check the output.
Diffstat (limited to 'llvm/lib/Support/YAMLTraits.cpp')
-rw-r--r--llvm/lib/Support/YAMLTraits.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Support/YAMLTraits.cpp b/llvm/lib/Support/YAMLTraits.cpp
index 1b5c79f6b592..df5e2cee7a0a 100644
--- a/llvm/lib/Support/YAMLTraits.cpp
+++ b/llvm/lib/Support/YAMLTraits.cpp
@@ -1046,7 +1046,8 @@ StringRef ScalarTraits<float>::input(StringRef Scalar, void *, float &Val) {
}
void ScalarTraits<Hex8>::output(const Hex8 &Val, void *, raw_ostream &Out) {
- Out << format("0x%" PRIX8, (uint8_t)Val);
+ uint8_t Num = Val;
+ Out << format("0x%02X", Num);
}
StringRef ScalarTraits<Hex8>::input(StringRef Scalar, void *, Hex8 &Val) {
@@ -1060,7 +1061,8 @@ StringRef ScalarTraits<Hex8>::input(StringRef Scalar, void *, Hex8 &Val) {
}
void ScalarTraits<Hex16>::output(const Hex16 &Val, void *, raw_ostream &Out) {
- Out << format("0x%" PRIX16, (uint16_t)Val);
+ uint16_t Num = Val;
+ Out << format("0x%04X", Num);
}
StringRef ScalarTraits<Hex16>::input(StringRef Scalar, void *, Hex16 &Val) {
@@ -1074,7 +1076,8 @@ StringRef ScalarTraits<Hex16>::input(StringRef Scalar, void *, Hex16 &Val) {
}
void ScalarTraits<Hex32>::output(const Hex32 &Val, void *, raw_ostream &Out) {
- Out << format("0x%" PRIX32, (uint32_t)Val);
+ uint32_t Num = Val;
+ Out << format("0x%08X", Num);
}
StringRef ScalarTraits<Hex32>::input(StringRef Scalar, void *, Hex32 &Val) {
@@ -1088,7 +1091,8 @@ StringRef ScalarTraits<Hex32>::input(StringRef Scalar, void *, Hex32 &Val) {
}
void ScalarTraits<Hex64>::output(const Hex64 &Val, void *, raw_ostream &Out) {
- Out << format("0x%" PRIX64, (uint64_t)Val);
+ uint64_t Num = Val;
+ Out << format("0x%016llX", Num);
}
StringRef ScalarTraits<Hex64>::input(StringRef Scalar, void *, Hex64 &Val) {