diff options
author | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2017-12-18 17:38:03 +0000 |
---|---|---|
committer | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2017-12-18 17:38:03 +0000 |
commit | 65ad22d969c8ddab46ce3661ca9eeec971c230e0 (patch) | |
tree | 43dfcc69994866f39ff42817e6315ded2a00594b /tools | |
parent | d6be2143517ce73716e991b7d4ebe1ec431900d9 (diff) |
[YAML] Add support for non-printable characters
LLVM IR function names which disable mangling start with '\01'
(https://www.llvm.org/docs/LangRef.html#identifiers).
When an identifier like "\01@abc@" gets dumped to MIR, it is quoted, but
only with single quotes.
http://www.yaml.org/spec/1.2/spec.html#id2770814:
"The allowed character range explicitly excludes the C0 control block
allowed), the surrogate block #xD800-#xDFFF, #xFFFE, and #xFFFF."
http://www.yaml.org/spec/1.2/spec.html#id2776092:
"All non-printable characters must be escaped.
[...]
Note that escape sequences are only interpreted in double-quoted scalars."
This patch adds support for printing escaped non-printable characters
between double quotes if needed.
Should also fix PR31743.
Differential Revision: https://reviews.llvm.org/D41290
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320996 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dsymutil/DebugMap.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/dsymutil/DebugMap.h b/tools/dsymutil/DebugMap.h index 2bdd333c838..3b5b437ccff 100644 --- a/tools/dsymutil/DebugMap.h +++ b/tools/dsymutil/DebugMap.h @@ -232,7 +232,7 @@ template <> struct MappingTraits<dsymutil::DebugMapObject> { template <> struct ScalarTraits<Triple> { static void output(const Triple &val, void *, raw_ostream &out); static StringRef input(StringRef scalar, void *, Triple &value); - static bool mustQuote(StringRef) { return true; } + static QuotingType mustQuote(StringRef) { return QuotingType::Single; } }; template <> |