Skip to content

Commit

Permalink
[TableGen] MacroFusionPredicatorEmitter - pass constant std::vector a…
Browse files Browse the repository at this point in the history
…rguments by ArrayRef instead

Silence pass by value warnings

Fixes #89210
  • Loading branch information
RKSimon committed Apr 19, 2024
1 parent 64cc3fa commit 26a59bf
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions llvm/utils/TableGen/MacroFusionPredicatorEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ class MacroFusionPredicatorEmitter {
RecordKeeper &Records;
CodeGenTarget Target;

void emitMacroFusionDecl(std::vector<Record *> Fusions, PredicateExpander &PE,
void emitMacroFusionDecl(ArrayRef<Record *> Fusions, PredicateExpander &PE,
raw_ostream &OS);
void emitMacroFusionImpl(std::vector<Record *> Fusions, PredicateExpander &PE,
void emitMacroFusionImpl(ArrayRef<Record *> Fusions, PredicateExpander &PE,
raw_ostream &OS);
void emitPredicates(std::vector<Record *> &FirstPredicate, bool IsCommutable,
void emitPredicates(ArrayRef<Record *> FirstPredicate, bool IsCommutable,
PredicateExpander &PE, raw_ostream &OS);
void emitFirstPredicate(Record *SecondPredicate, bool IsCommutable,
PredicateExpander &PE, raw_ostream &OS);
Expand All @@ -76,7 +76,7 @@ class MacroFusionPredicatorEmitter {
} // End anonymous namespace.

void MacroFusionPredicatorEmitter::emitMacroFusionDecl(
std::vector<Record *> Fusions, PredicateExpander &PE, raw_ostream &OS) {
ArrayRef<Record *> Fusions, PredicateExpander &PE, raw_ostream &OS) {
OS << "#ifdef GET_" << Target.getName() << "_MACRO_FUSION_PRED_DECL\n";
OS << "#undef GET_" << Target.getName() << "_MACRO_FUSION_PRED_DECL\n\n";
OS << "namespace llvm {\n";
Expand All @@ -93,7 +93,7 @@ void MacroFusionPredicatorEmitter::emitMacroFusionDecl(
}

void MacroFusionPredicatorEmitter::emitMacroFusionImpl(
std::vector<Record *> Fusions, PredicateExpander &PE, raw_ostream &OS) {
ArrayRef<Record *> Fusions, PredicateExpander &PE, raw_ostream &OS) {
OS << "#ifdef GET_" << Target.getName() << "_MACRO_FUSION_PRED_IMPL\n";
OS << "#undef GET_" << Target.getName() << "_MACRO_FUSION_PRED_IMPL\n\n";
OS << "namespace llvm {\n";
Expand Down Expand Up @@ -121,9 +121,10 @@ void MacroFusionPredicatorEmitter::emitMacroFusionImpl(
OS << "\n#endif\n";
}

void MacroFusionPredicatorEmitter::emitPredicates(
std::vector<Record *> &Predicates, bool IsCommutable, PredicateExpander &PE,
raw_ostream &OS) {
void MacroFusionPredicatorEmitter::emitPredicates(ArrayRef<Record *> Predicates,
bool IsCommutable,
PredicateExpander &PE,
raw_ostream &OS) {
for (Record *Predicate : Predicates) {
Record *Target = Predicate->getValueAsDef("Target");
if (Target->getName() == "first_fusion_target")
Expand Down

0 comments on commit 26a59bf

Please sign in to comment.