getPredicateRecords(PredicateRecs);
SmallString<128> PredicateCheck;
+ raw_svector_ostream OS(PredicateCheck);
+ ListSeparator LS(" && ");
for (Record *Pred : PredicateRecs) {
StringRef CondString = Pred->getValueAsString("CondString");
if (CondString.empty())
continue;
- if (!PredicateCheck.empty())
- PredicateCheck += " && ";
- PredicateCheck += "(";
- PredicateCheck += CondString;
- PredicateCheck += ")";
+ OS << LS << '(' << CondString << ')';
}
- if (!HwModeFeatures.empty()) {
- if (!PredicateCheck.empty())
- PredicateCheck += " && ";
- PredicateCheck += HwModeFeatures;
- }
+ if (!HwModeFeatures.empty())
+ OS << LS << HwModeFeatures;
return std::string(PredicateCheck);
}