[PATCH] D75919: Teach the MLIR AsmPrinter to correctly escape asm names that use invalid characters.

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 11 17:11:25 PDT 2020


rriddle accepted this revision.
rriddle added a comment.
This revision is now accepted and ready to land.

Sorry, I forgot to hit submit. Avoiding the use of string is fine for now, as it keeps this specific to this one part of the printer.



================
Comment at: mlir/lib/IR/AsmPrinter.cpp:763
 
+// Returns true if 'c' is an allowable punctuation character: [$._-]
+// Returns false otherwise.
----------------
Please use /// for top-level comments.


================
Comment at: mlir/lib/IR/AsmPrinter.cpp:788
+    SmallString<16> tmpName;
+    for (auto ch : name) {
+      if (isalpha(ch) || isPunct(ch) || isdigit(ch))
----------------
nit: auto -> char?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75919





More information about the llvm-commits mailing list