Revert "YAMLIO: Encode ambiguous hex strings explicitly"
This reverts commit r205839.
It broke several tests in lld.
llvm-svn: 205857
diff --git a/llvm/lib/Support/YAMLTraits.cpp b/llvm/lib/Support/YAMLTraits.cpp
index 3b4bb7d..38f3ec7 100644
--- a/llvm/lib/Support/YAMLTraits.cpp
+++ b/llvm/lib/Support/YAMLTraits.cpp
@@ -561,11 +561,8 @@
this->outputUpToEndOfLine("''");
return;
}
- bool isOctalString = S.front() == '0' &&
- S.find_first_not_of('0') != StringRef::npos &&
- !S.startswith_lower("0x");
if (S.find_first_not_of(ScalarSafeChars) == StringRef::npos &&
- !isspace(S.front()) && !isspace(S.back()) && !isOctalString) {
+ !isspace(S.front()) && !isspace(S.back())) {
// If the string consists only of safe characters, print it out without
// quotes.
this->outputUpToEndOfLine(S);