[PATCH] D91460: [AsmParser] make .ascii support spaces as separators

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 30 15:00:13 PST 2020


jrtc27 added inline comments.


================
Comment at: llvm/lib/MC/MCParser/AsmParser.cpp:3017-3030
+  auto parseManyWithOptionalComma = [&]() -> bool {
+    if (parseOptionalToken(AsmToken::EndOfStatement))
+      return false;
+    while (true) {
+      if (parseOp())
+        return true;
+      if (parseOptionalToken(AsmToken::EndOfStatement))
----------------
It'd be nicer to push this all up into parseOp so it just parses all the strings it finds one at a time. For `.ascii` you can get away with treating spaces and commas the same, but if we ever want to support the new `.asciz`/`.string` behaviour (which I feel we should one day, provided binutils doesn't decide to revert its behaviour) we'll need it to be like that, so it'd make it trivial to enable. Also I feel it's a cleaner (and likely simpler) way to write it regardless.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91460



More information about the llvm-commits mailing list