forked from OSchip/llvm-project
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
This commit is contained in:
parent
0856bde8db
commit
d9eb2d1401
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue