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

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 10:51:05 PDT 2020


rriddle marked 2 inline comments as done.
rriddle 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
----------------
dblaikie wrote:
> dexonsmith wrote:
> > Can this change be separated out and committed first? It doesn't seem tightly entangled to me...
> +1 for this being a separate NFC/perf-only change (would be good to have some perf measurements to support the change too)
Done, thanks! Split out to https://reviews.llvm.org/D90320.


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