[llvm] [SandboxIR] Added setVolatile member function to LoadInst and StoreInst (PR #101284)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 31 08:50:38 PDT 2024


================
@@ -825,6 +827,11 @@ class StoreInst final : public Instruction {
 public:
   /// Return true if this is a store from a volatile memory location.
   bool isVolatile() const { return cast<llvm::StoreInst>(Val)->isVolatile(); }
+  /// Specify whether this is a volatile store or not.
+  void setVolatile(bool V) {
+    return cast<llvm::StoreInst>(Val)->setVolatile(V);
----------------
vporpo wrote:

Same here:
```
  auto &Tracker = getTracker();
  if (Tracker.isTracking())
    Tracker.track(Change: std::make_unique<SetVolatile>(cast<lnstruction>(this)), Tracker));
  cast<llvm::StoreInst>(Val)->setVolatile(V);
```

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


More information about the llvm-commits mailing list