Bitcode: Use unsigned char to record MDStrings
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 11 Dec 2014 23:34:30 +0000 (23:34 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 11 Dec 2014 23:34:30 +0000 (23:34 +0000)
commit4bedb4875184d73f778ae2bf1f5cc65289b14b4d
tree27eabc0d93f7d891a861012758aca24dbf5a2c07
parent033d8ea7a9749b7c1573d32f34e522f2fb7eb393
Bitcode: Use unsigned char to record MDStrings

`MDString`s can have arbitrary characters in them.  Prevent an assertion
that fired in `BitcodeWriter` because of sign extension by copying the
characters into the record as `unsigned char`s.

Based on a patch by Keno Fischer; fixes PR21882.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224077 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/StringRef.h
include/llvm/IR/Metadata.h
lib/Bitcode/Writer/BitcodeWriter.cpp
test/Bitcode/mdstring-high-bits.ll [new file with mode: 0644]