diff --git a/utils/TableGen/FixedLenDecoderEmitter.cpp b/utils/TableGen/FixedLenDecoderEmitter.cpp index b5a280ba1a5..1c03296fe41 100644 --- a/utils/TableGen/FixedLenDecoderEmitter.cpp +++ b/utils/TableGen/FixedLenDecoderEmitter.cpp @@ -1210,14 +1210,9 @@ bool FilterChooser::emitPredicateMatch(raw_ostream &o, unsigned &Indentation, if (IsOr) o << "("; - bool First = true; + ListSeparator LS(IsOr ? " || " : " && "); for (auto *Arg : D->getArgs()) { - if (!First) { - if (IsOr) - o << " || "; - else - o << " && "; - } + o << LS; if (auto *NotArg = dyn_cast(Arg)) { if (NotArg->getOperator()->getAsString() != "not" || NotArg->getNumArgs() != 1) @@ -1230,8 +1225,6 @@ bool FilterChooser::emitPredicateMatch(raw_ostream &o, unsigned &Indentation, PrintFatalError(Pred->getLoc(), "Invalid AssemblerCondDag!"); o << "Bits[" << Emitter->PredicateNamespace << "::" << Arg->getAsString() << "]"; - - First = false; } if (IsOr) diff --git a/utils/TableGen/SubtargetFeatureInfo.cpp b/utils/TableGen/SubtargetFeatureInfo.cpp index 105ed82c9d0..33a22776f2d 100644 --- a/utils/TableGen/SubtargetFeatureInfo.cpp +++ b/utils/TableGen/SubtargetFeatureInfo.cpp @@ -130,14 +130,9 @@ void SubtargetFeatureInfo::emitComputeAssemblerAvailableFeatures( if (IsOr) OS << "("; - bool First = true; + ListSeparator LS(IsOr ? " || " : " && "); for (auto *Arg : D->getArgs()) { - if (!First) { - if (IsOr) - OS << " || "; - else - OS << " && "; - } + OS << LS; if (auto *NotArg = dyn_cast(Arg)) { if (NotArg->getOperator()->getAsString() != "not" || NotArg->getNumArgs() != 1) @@ -149,8 +144,6 @@ void SubtargetFeatureInfo::emitComputeAssemblerAvailableFeatures( !cast(Arg)->getDef()->isSubClassOf("SubtargetFeature")) PrintFatalError(SFI.TheDef->getLoc(), "Invalid AssemblerCondDag!"); OS << "FB[" << TargetName << "::" << Arg->getAsString() << "]"; - - First = false; } if (IsOr)