[StringExtras] Add a fromHex to complement toHex.
authorZachary Turner <zturner@google.com>
Tue, 25 Apr 2017 20:21:35 +0000 (20:21 +0000)
committerZachary Turner <zturner@google.com>
Tue, 25 Apr 2017 20:21:35 +0000 (20:21 +0000)
commite46b4498b8f11925986704196094eb6a89f6e3dc
tree37c5d2542da365ca1f66184ff66cb8cf223bf220
parent9b52d67e1729f5972cdd366c62f314de531c3f7d
[StringExtras] Add a fromHex to complement toHex.

We already have a function toHex that will convert a string like
"\xFF\xFF" to the string "FFFF", but we do not have one that goes
the other way - i.e. to convert a textual string representing a
sequence of hexadecimal characters into the corresponding actual
bytes.  This patch adds such a function.

llvm-svn: 301356
llvm/include/llvm/ADT/StringExtras.h
llvm/unittests/ADT/StringExtrasTest.cpp