AsmWriter: Escape string fields in metadata
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sat, 28 Feb 2015 22:20:16 +0000 (22:20 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sat, 28 Feb 2015 22:20:16 +0000 (22:20 +0000)
commit837f19eb8056fae374630f7762d34d12f7bd6a92
tree106cd7bc8227286e7003d0aa97747c7b2e05b44c
parent9973291e83bebe731132a0f7645ead7426dbc10c
AsmWriter: Escape string fields in metadata

Properly escape string fields in metadata.  I've added a spot-check with
direct coverage for `MDFile::getFilename()`, but we'll get more coverage
once the hierarchy is moved into place (since this comes up in various
checked-in testcases).

I've replicated the `if` logic using the `ShouldSkipEmpty` flag
(although a follow-up commit is going to change how often this flag is
specified); no NFCI other than escaping the string fields.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230875 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/AsmWriter.cpp
test/Assembler/mdfile-escaped-chars.ll [new file with mode: 0644]