[llvm] [SandboxIR] Add callbacks for instruction insert/remove/move ops. (PR #112965)

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 18 14:00:24 PDT 2024


================
@@ -198,6 +233,26 @@ class Context {
 
   /// \Returns the number of values registered with Context.
   size_t getNumValues() const { return LLVMValueToValueMap.size(); }
+
+  /// Register a callback that gets called when a SandboxIR instruction is about
+  /// to be removed from its parent. Note that this will also be called when
+  /// reverting the creation of an instruction.
+  /// \Returns a callback ID for later deregistration.
+  int registerRemoveInstrCallback(RemoveInstrCallback CB);
----------------
aeubanks wrote:

```suggestion
  CallbackID registerRemoveInstrCallback(RemoveInstrCallback CB);
```
ditto below

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


More information about the llvm-commits mailing list