[PATCH] D50839: [llvm] Optimize YAML::isNumeric

Joerg Sonnenberger via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 16 06:52:21 PDT 2018


joerg added inline comments.


================
Comment at: llvm/include/llvm/Support/YAMLTraits.h:477
+      if (ParseOct && std::find(std::begin(OctalChars), std::end(OctalChars),
+                                Char) == std::end(OctalChars))
+        return false;
----------------
Can you use strchr here? I would expect the compiler to fold the string constants into bit tests, creating both more compact and faster code.


https://reviews.llvm.org/D50839





More information about the cfe-commits mailing list