[PATCH] D69773: [APFloat] Extend converting from special strings

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 17:34:34 PST 2019


hfinkel added inline comments.


================
Comment at: llvm/lib/Support/APFloat.cpp:2663
+    // 'Q').
+    if (str[0] != 'N' && str[0] != (C + NDiff))
+      return false;
----------------
My impression is that this logic involving NDiff is here to make sure that the case matches, correct? This makes the code hard to follow. Frankly, if this is just a feature for us (to make it easier to write FP numbers in textual LLVM IR), why bother checking for the case matching at all?  Just do a case-insensitive match. Otherwise, you can also match and then just check that: `isupper(str[0]) == isupper(str[2])`, no?



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

https://reviews.llvm.org/D69773





More information about the llvm-commits mailing list