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

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 31 14:07:05 PDT 2024


================
@@ -160,26 +160,28 @@ void CallBrInstSetIndirectDest::dump() const {
 }
 #endif
 
-SetVolatile::SetVolatile(Instruction *I, bool WasBool, Tracker &Tracker)
-    : IRChangeBase(Tracker), Inst(I) {
-  if (auto *Load = cast<llvm::LoadInst>(Inst)) {
+SetVolatile::SetVolatile(Instruction *I, Tracker &Tracker)
+    : IRChangeBase(Tracker) {
+  if (auto *Load = cast<llvm::LoadInst>(I)) {
----------------
vporpo wrote:

This can't be right. You may have missed a `*` somewhere.
There is very similar code in `RemoveFromParent::revert` constructor. In that class `NextInstrOrBB` is a `PointerUnion<Instruction *, BasicBlock *>` and we can cast it as `if (auto *NextI = NextInstrOrBB.dyn_cast<Instruction *>())` where `auto` is `Instruction`.

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


More information about the llvm-commits mailing list