================
@@ -335,6 +335,111 @@ static ParseResult parseCIRKeyword(AsmParser &parser,
RetTy &result) {
return success();
}
+/// The memory classes that can be named individually, in the order they
+/// print. Positional: parseMemoryEffects and printMemoryEffects both index
+/// by position, so a class added here needs an access added alongside it in
+/// both. The spellings are LLVM's own, which underscores the target pair
+/// but not the rest.
+static constexpr llvm::StringLiteral memoryClassNames[] = {
+ "argmem", "inaccessiblemem", "errnomem", "target_mem0", "target_mem1"};
+
+/// Print memory effects in LLVM's compact form, except that the two target
+/// classes always print by name rather than collapsing to `target_mem`. The
+/// access covering every class not named individually comes first, then only
+/// the classes differing from it. That leading access is left out when it is
+/// `none` and some class does differ, since an unnamed class reads back as
+/// `none`.
+static void printMemoryEffects(mlir::AsmPrinter &printer,
----------------
erichkeane wrote:
Why can't we just use the builtin-printer/parser for the memory effects? IS it
that much worse that we need all of this?
https://github.com/llvm/llvm-project/pull/223890
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits