[clang] [llvm] [mlir] [LLVM] Improve IR parsing and printing for target memory locations (PR #176968)

Antonio Frighetto via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 27 03:18:10 PST 2026


================
@@ -2568,20 +2568,37 @@ bool LLParser::parseAllocKind(AllocFnKind &Kind) {
   return false;
 }
 
-static std::optional<MemoryEffects::Location> keywordToLoc(lltok::Kind Tok) {
+static ArrayRef<IRMemLocation> keywordToLoc(lltok::Kind Tok) {
+  using Loc = IRMemLocation;
+
+  static constexpr Loc ArgMem[] = {Loc::ArgMem};
----------------
antoniofrighetto wrote:

```suggestion
  static constexpr auto ArgMem = {Loc::ArgMem};
```
Etc. for the others.

https://github.com/llvm/llvm-project/pull/176968


More information about the cfe-commits mailing list