================
@@ -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};
+  static constexpr Loc InaccessibleMem[] = {Loc::InaccessibleMem};
+  static constexpr Loc ErrnoMem[] = {Loc::ErrnoMem};
+  static constexpr Loc TargetMem0[] = {Loc::TargetMem0};
+  static constexpr Loc TargetMem1[] = {Loc::TargetMem1};
+  static constexpr Loc TargetMem[] = {Loc::TargetMem0, Loc::TargetMem1};
   switch (Tok) {
   case lltok::kw_argmem:
-    return IRMemLocation::ArgMem;
+    return ArgMem;
+
   case lltok::kw_inaccessiblemem:
-    return IRMemLocation::InaccessibleMem;
+    return InaccessibleMem;
+
   case lltok::kw_errnomem:
-    return IRMemLocation::ErrnoMem;
+    return ErrnoMem;
+
   case lltok::kw_target_mem0:
-    return IRMemLocation::TargetMem0;
+    return TargetMem0;
+
   case lltok::kw_target_mem1:
-    return IRMemLocation::TargetMem1;
+    return TargetMem1;
+
+  // In the case this represent all target memories
----------------
antoniofrighetto wrote:

```suggestion
  // In the case this represents all target memories.
```

https://github.com/llvm/llvm-project/pull/176968
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to