Skip to content

Commit da37139

Browse files
authored
[BOLT][NFC] Add allocator id to MCPlusBuilder::setLabel (#68707)
This will be needed for some RISC-V instrumentation functions and is also consistent with other annotation setters.
1 parent 59fec73 commit da37139

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ class MCPlusBuilder {
11851185

11861186
/// Set the label of \p Inst. This label will be emitted right before \p Inst
11871187
/// is emitted to MCStreamer.
1188-
bool setLabel(MCInst &Inst, MCSymbol *Label);
1188+
bool setLabel(MCInst &Inst, MCSymbol *Label, AllocatorIdTy AllocatorId = 0);
11891189

11901190
/// Return MCSymbol that represents a target of this instruction at a given
11911191
/// operand number \p OpNum. If there's no symbol associated with

bolt/lib/Core/MCPlusBuilder.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,10 @@ std::optional<MCSymbol *> MCPlusBuilder::getLabel(const MCInst &Inst) const {
274274
return std::nullopt;
275275
}
276276

277-
bool MCPlusBuilder::setLabel(MCInst &Inst, MCSymbol *Label) {
278-
getOrCreateAnnotationAs<MCSymbol *>(Inst, MCAnnotation::kLabel) = Label;
277+
bool MCPlusBuilder::setLabel(MCInst &Inst, MCSymbol *Label,
278+
AllocatorIdTy AllocatorId) {
279+
getOrCreateAnnotationAs<MCSymbol *>(Inst, MCAnnotation::kLabel, AllocatorId) =
280+
Label;
279281
return true;
280282
}
281283

0 commit comments

Comments
 (0)