[IR/AsmWriter] Output escape sequences if the first character isdigit()
authorFilipe Cabecinhas <me@filcab.net>
Tue, 2 Jun 2015 21:25:08 +0000 (21:25 +0000)
committerFilipe Cabecinhas <me@filcab.net>
Tue, 2 Jun 2015 21:25:08 +0000 (21:25 +0000)
commit6af0f89f372bf60f1a503e038b2d57e968d065c9
tree68f05aed667db892172e47ffab06837006bf2b4c
parent66774f6700fe80024004deef7094acf228693c44
[IR/AsmWriter] Output escape sequences if the first character isdigit()

If the first character in a metadata attachment's name is a digit, it has
to be output using an escape sequence, otherwise it's not valid text IR.

Removed an over-zealous assert from LLVMContext which didn't allow this.
The rule should only apply to text IR. Actual names can have any sequence
of non-NUL bytes.

Also added some documentation on accepted names.

Bug found with AFL fuzz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238867 91177308-0d34-0410-b5e6-96231b3b80d8
docs/LangRef.rst
lib/IR/AsmWriter.cpp
lib/IR/LLVMContext.cpp
test/Assembler/metadata.ll