[PATCH] D90265: [llvm][StringExtras] Add a fail-able version of `fromHex` and optimize hex digit lookup

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 08:49:44 PDT 2020


dexonsmith accepted this revision.
dexonsmith added inline comments.


================
Comment at: llvm/include/llvm/ADT/StringExtras.h:70-101
+  static unsigned LUT[255] = {
+    /// 0-47: Non hexadecimal digits
+    -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U,
+    -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U,
+    -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U, -1U,
+    -1U, -1U, -1U,
+    /// 48-57: `0`-`9` hexadecimal digits
----------------
Can this change be separated out and committed first? It doesn't seem tightly entangled to me...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90265/new/

https://reviews.llvm.org/D90265



More information about the llvm-commits mailing list