[PATCH] D109215: [RISCV] Fix arch string parsing for multi-character extensions

Dawid Jurczak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 23 03:14:48 PDT 2021


yurai007 added inline comments.


================
Comment at: llvm/lib/Support/RISCVISAInfo.cpp:74
 
+static size_t findFirstNonVersionCharacter(const StringRef &Ext) {
+  int Pos = Ext.size() - 1;
----------------
Please put short comment which pattern is the correct one. From implementation it looks like [0-9]*p?[0-9]*, right? For now function is not allowed to get empty strings. If it's deliberate would be good to put information about it in comment too. Last but not least - for some input function returns max size_t value due to Pos = -1 conversion to size_t. I'm not sure how paranoid about this we should be since I don't know how limited is set of potential Ext input.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109215



More information about the llvm-commits mailing list