@@ -664,56 +664,53 @@ Module *Context::createModule(llvm::Module *LLVMM) {
664664}
665665
666666void Context::runRemoveInstrCallbacks (Instruction *I) {
667- for (const auto &CBEntry : RemoveInstrCallbacks) {
667+ for (const auto &CBEntry : RemoveInstrCallbacks)
668668 CBEntry.second (I);
669- }
670669}
671670
672671void Context::runInsertInstrCallbacks (Instruction *I) {
673- for (auto &CBEntry : InsertInstrCallbacks) {
672+ for (auto &CBEntry : InsertInstrCallbacks)
674673 CBEntry.second (I);
675- }
676674}
677675
678676void Context::runMoveInstrCallbacks (Instruction *I, const BBIterator &WhereIt) {
679- for (auto &CBEntry : MoveInstrCallbacks) {
677+ for (auto &CBEntry : MoveInstrCallbacks)
680678 CBEntry.second (I, WhereIt);
681- }
682679}
683680
684- int Context::NextCallbackId = 0 ;
681+ Context::CallbackID Context::NextCallbackID = 0 ;
685682
686683int Context::registerRemoveInstrCallback (RemoveInstrCallback CB) {
687- int Id = NextCallbackId ++;
688- RemoveInstrCallbacks[Id ] = CB;
689- return Id ;
684+ CallbackID ID = NextCallbackID ++;
685+ RemoveInstrCallbacks[ID ] = CB;
686+ return ID ;
690687}
691- void Context::unregisterRemoveInstrCallback (int CallbackId ) {
692- [[maybe_unused]] bool erased = RemoveInstrCallbacks.erase (CallbackId );
688+ void Context::unregisterRemoveInstrCallback (CallbackID ID ) {
689+ [[maybe_unused]] bool erased = RemoveInstrCallbacks.erase (ID );
693690 assert (erased &&
694- " Callback id not found in RemoveInstrCallbacks during deregistration" );
691+ " Callback ID not found in RemoveInstrCallbacks during deregistration" );
695692}
696693
697694int Context::registerInsertInstrCallback (InsertInstrCallback CB) {
698- int Id = NextCallbackId ++;
699- InsertInstrCallbacks[Id ] = CB;
700- return Id ;
695+ CallbackID ID = NextCallbackID ++;
696+ InsertInstrCallbacks[ID ] = CB;
697+ return ID ;
701698}
702- void Context::unregisterInsertInstrCallback (int CallbackId ) {
703- [[maybe_unused]] bool erased = InsertInstrCallbacks.erase (CallbackId );
699+ void Context::unregisterInsertInstrCallback (CallbackID ID ) {
700+ [[maybe_unused]] bool erased = InsertInstrCallbacks.erase (ID );
704701 assert (erased &&
705- " Callback id not found in InsertInstrCallbacks during deregistration" );
702+ " Callback ID not found in InsertInstrCallbacks during deregistration" );
706703}
707704
708705int Context::registerMoveInstrCallback (MoveInstrCallback CB) {
709- int Id = NextCallbackId ++;
710- MoveInstrCallbacks[Id ] = CB;
711- return Id ;
706+ CallbackID ID = NextCallbackID ++;
707+ MoveInstrCallbacks[ID ] = CB;
708+ return ID ;
712709}
713- void Context::unregisterMoveInstrCallback (int CallbackId ) {
714- [[maybe_unused]] bool erased = MoveInstrCallbacks.erase (CallbackId );
710+ void Context::unregisterMoveInstrCallback (CallbackID ID ) {
711+ [[maybe_unused]] bool erased = MoveInstrCallbacks.erase (ID );
715712 assert (erased &&
716- " Callback id not found in MoveInstrCallbacks during deregistration" );
713+ " Callback ID not found in MoveInstrCallbacks during deregistration" );
717714}
718715
719716} // namespace llvm::sandboxir
0 commit comments