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

Jorge Gorbe Moya via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 18 13:56:55 PDT 2024


================
@@ -660,4 +663,57 @@ Module *Context::createModule(llvm::Module *LLVMM) {
   return M;
 }
 
+void Context::runRemoveInstrCallbacks(Instruction *I) {
+  for (const auto &CBEntry : RemoveInstrCallbacks) {
+    CBEntry.second(I);
+  }
+}
+
+void Context::runInsertInstrCallbacks(Instruction *I) {
+  for (auto &CBEntry : InsertInstrCallbacks) {
+    CBEntry.second(I);
+  }
+}
+
+void Context::runMoveInstrCallbacks(Instruction *I, const BBIterator &WhereIt) {
+  for (auto &CBEntry : MoveInstrCallbacks) {
----------------
slackito wrote:

Fixed.

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


More information about the llvm-commits mailing list