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 non-printable characters between double quotes if needed.
This part is sketchy. As we are most probably dealing with UTF-8 without having fully parsed code point here. (Not that the code/comments give any indication that we indeed have UTF-8). While for ASCII (= top bit is clear) UTF-8 and ASCII are the same, for other characters (top bit set) it is not.
I think the best/easiest thing to do here is to always trigger double quoting on (C & 0x80) != 0