Skip to content

Commit e84e9e6

Browse files
committed
Another round of feedback.
- Updated callback (de)registration method signatures in header to use the CallbackID type instead of int. - Corrected case in some variable names to follow the style guide.
1 parent f361d5c commit e84e9e6

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

llvm/include/llvm/SandboxIR/Context.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,21 +238,21 @@ class Context {
238238
/// to be removed from its parent. Note that this will also be called when
239239
/// reverting the creation of an instruction.
240240
/// \Returns a callback ID for later deregistration.
241-
int registerRemoveInstrCallback(RemoveInstrCallback CB);
242-
void unregisterRemoveInstrCallback(int CallbackId);
241+
CallbackID registerRemoveInstrCallback(RemoveInstrCallback CB);
242+
void unregisterRemoveInstrCallback(CallbackID ID);
243243

244244
/// Register a callback that gets called right after a SandboxIR instruction
245245
/// is created. Note that this will also be called when reverting the removal
246246
/// of an instruction.
247247
/// \Returns a callback ID for later deregistration.
248-
int registerInsertInstrCallback(InsertInstrCallback CB);
249-
void unregisterInsertInstrCallback(int CallbackId);
248+
CallbackID registerInsertInstrCallback(InsertInstrCallback CB);
249+
void unregisterInsertInstrCallback(CallbackID ID);
250250

251251
/// Register a callback that gets called when a SandboxIR instruction is about
252252
/// to be moved. Note that this will also be called when reverting a move.
253253
/// \Returns a callback ID for later deregistration.
254-
int registerMoveInstrCallback(MoveInstrCallback CB);
255-
void unregisterMoveInstrCallback(int CallbackId);
254+
CallbackID registerMoveInstrCallback(MoveInstrCallback CB);
255+
void unregisterMoveInstrCallback(CallbackID ID);
256256
};
257257

258258
} // namespace llvm::sandboxir

llvm/lib/SandboxIR/Context.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -686,8 +686,8 @@ int Context::registerRemoveInstrCallback(RemoveInstrCallback CB) {
686686
return ID;
687687
}
688688
void Context::unregisterRemoveInstrCallback(CallbackID ID) {
689-
[[maybe_unused]] bool erased = RemoveInstrCallbacks.erase(ID);
690-
assert(erased &&
689+
[[maybe_unused]] bool Erased = RemoveInstrCallbacks.erase(ID);
690+
assert(Erased &&
691691
"Callback ID not found in RemoveInstrCallbacks during deregistration");
692692
}
693693

@@ -697,8 +697,8 @@ int Context::registerInsertInstrCallback(InsertInstrCallback CB) {
697697
return ID;
698698
}
699699
void Context::unregisterInsertInstrCallback(CallbackID ID) {
700-
[[maybe_unused]] bool erased = InsertInstrCallbacks.erase(ID);
701-
assert(erased &&
700+
[[maybe_unused]] bool Erased = InsertInstrCallbacks.erase(ID);
701+
assert(Erased &&
702702
"Callback ID not found in InsertInstrCallbacks during deregistration");
703703
}
704704

@@ -708,8 +708,8 @@ int Context::registerMoveInstrCallback(MoveInstrCallback CB) {
708708
return ID;
709709
}
710710
void Context::unregisterMoveInstrCallback(CallbackID ID) {
711-
[[maybe_unused]] bool erased = MoveInstrCallbacks.erase(ID);
712-
assert(erased &&
711+
[[maybe_unused]] bool Erased = MoveInstrCallbacks.erase(ID);
712+
assert(Erased &&
713713
"Callback ID not found in MoveInstrCallbacks during deregistration");
714714
}
715715

0 commit comments

Comments
 (0)