diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2014-03-20 06:28:52 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2014-03-20 06:28:52 +0000 |
| commit | d9eb2d1401a21e6771d5ce720df03b59d819a807 (patch) | |
| tree | 67dad9a4e5cb0fa4077d514ff2ed28e3921190d7 /llvm | |
| parent | 0856bde8db408f60767f33c9fb229956d13e4be9 (diff) | |
| download | bcm5719-llvm-d9eb2d1401a21e6771d5ce720df03b59d819a807.tar.gz bcm5719-llvm-d9eb2d1401a21e6771d5ce720df03b59d819a807.zip | |
Object: Don't double-escape empty hexdata
We would emit a pair of double quotes inside a pair of single quotes.
Just use a pair of single quotes.
llvm-svn: 204312
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Object/YAML.cpp | 4 | ||||
| -rw-r--r-- | llvm/unittests/Object/YAMLTest.cpp | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Object/YAML.cpp b/llvm/lib/Object/YAML.cpp index c527bde090e..61e9da30395 100644 --- a/llvm/lib/Object/YAML.cpp +++ b/llvm/lib/Object/YAML.cpp @@ -51,10 +51,8 @@ void BinaryRef::writeAsBinary(raw_ostream &OS) const { } void BinaryRef::writeAsHex(raw_ostream &OS) const { - if (binary_size() == 0) { - OS << "\"\""; + if (binary_size() == 0) return; - } if (DataIsHexString) { OS.write((const char *)Data.data(), Data.size()); return; diff --git a/llvm/unittests/Object/YAMLTest.cpp b/llvm/unittests/Object/YAMLTest.cpp index 3ae92ae1bae..1eb1113ae6b 100644 --- a/llvm/unittests/Object/YAMLTest.cpp +++ b/llvm/unittests/Object/YAMLTest.cpp @@ -34,5 +34,5 @@ TEST(ObjectYAML, BinaryRef) { llvm::raw_svector_ostream OS(Buf); yaml::Output YOut(OS); YOut << BH; - EXPECT_NE(OS.str().find("\"\""), StringRef::npos); + EXPECT_NE(OS.str().find("''"), StringRef::npos); } |

