Skip to content

Commit b342d87

Browse files
authored
[TableGen][NFC] Add maybe_unused to MRI (#87044)
This suppresses warning `unused variable 'MRI' [-Wunused-variable]` for those fusions that don't need `MRI`.
1 parent 8827ff9 commit b342d87

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/utils/TableGen/MacroFusionPredicatorEmitter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ void MacroFusionPredicatorEmitter::emitMacroFusionImpl(
108108
OS.indent(4) << "const TargetSubtargetInfo &STI,\n";
109109
OS.indent(4) << "const MachineInstr *FirstMI,\n";
110110
OS.indent(4) << "const MachineInstr &SecondMI) {\n";
111-
OS.indent(2) << "auto &MRI = SecondMI.getMF()->getRegInfo();\n";
111+
OS.indent(2)
112+
<< "[[maybe_unused]] auto &MRI = SecondMI.getMF()->getRegInfo();\n";
112113

113114
emitPredicates(Predicates, IsCommutable, PE, OS);
114115

0 commit comments

Comments
 (0)