[PATCH] D88065: [lld-macho] Make lld::getInteger() tolerate leading "0x"/"0X" when base is 16

Greg McGary via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 14:34:28 PDT 2020


gkm added inline comments.


================
Comment at: lld/Common/Args.cpp:39
+    s = s.drop_front(2);
+  if (to_integer(s, v, base))
     return v;
----------------
MaskRay wrote:
> If base == 0, to_integer can parse the 0x prefix.
I am unclear about the intention of your statement. Are you suggesting that I change `base` to `0` and let `to_integer()` strip the `0x` ?
I considered that, but that way we perform the `0x` detection twice.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88065



More information about the llvm-commits mailing list