[clang] [llvm] Extend MemoryEffects to Support Target-Specific Memory Locations (PR #148650)
Paul Walker via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 23 07:36:09 PDT 2025
================
@@ -449,6 +462,22 @@ void CodeGenIntrinsic::setProperty(const Record *R) {
}
}
+llvm::IRMemLocation
+CodeGenIntrinsic::getValueAsIRMemLocation(const Record *R) const {
+ StringRef Name = R->getName();
+ IRMemLocation Loc =
+ StringSwitch<IRMemLocation>(Name)
+ .Case("TargetMem0", IRMemLocation::TargetMem0)
+ .Case("TargetMem1", IRMemLocation::TargetMem1)
+ .Case("InaccessibleMem", IRMemLocation::InaccessibleMem)
+ .Default(IRMemLocation::Other); // fallback enum
+
+ if (Loc == IRMemLocation::Other)
+ PrintFatalError(R->getLoc(), "unknown Target IRMemLocation: " + Name);
----------------
paulwalker-arm wrote:
```suggestion
PrintFatalError(R->getLoc(), "unknown IRMemLocation: " + Name);
```
https://github.com/llvm/llvm-project/pull/148650
More information about the llvm-commits
mailing list