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

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 31 13:46:32 PDT 2024


================
@@ -610,6 +610,14 @@ void BranchInst::dump() const {
 }
 #endif // NDEBUG
 
+void LoadInst::setVolatile(bool V) {
+  auto &Tracker = Ctx.getTracker();
+  if (Tracker.isTracking())
+    Tracker.track(
+        std::make_unique<SetVolatile>(cast<Instruction>(this), Tracker));
----------------
vporpo wrote:

Hmm, this `cast<Instruction>(this)` shouldn't be needed as `this` is already an Instruction. So replacing it with `this` should work too.

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


More information about the llvm-commits mailing list