This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
Differential Revision: https://reviews.llvm.org/D71807
return true;
if (A.size() > B.size())
return false;
- for (const auto &Pair : zip(A, B)) {
+ for (auto Pair : zip(A, B)) {
if (std::get<0>(Pair)->getName() < std::get<1>(Pair)->getName())
return true;
if (std::get<0>(Pair)->getName() > std::get<1>(Pair)->getName())
return true;
if (A.size() > B.size())
return false;
- for (const auto &Pair : zip(A, B)) {
+ for (auto Pair : zip(A, B)) {
if (std::get<0>(Pair)->getName() < std::get<1>(Pair)->getName())
return true;
if (std::get<0>(Pair)->getName() > std::get<1>(Pair)->getName())
/// Return true if S has no element (vector type) that T is a sub-vector of,
/// i.e. has the same element type as T and more elements.
auto NoSubV = [&IsSubVec](const TypeSetByHwMode::SetType &S, MVT T) -> bool {
- for (const auto &I : S)
+ for (auto I : S)
if (IsSubVec(T, I))
return false;
return true;
/// Return true if S has no element (vector type) that T is a super-vector
/// of, i.e. has the same element type as T and fewer elements.
auto NoSupV = [&IsSubVec](const TypeSetByHwMode::SetType &S, MVT T) -> bool {
- for (const auto &I : S)
+ for (auto I : S)
if (IsSubVec(I, T))
return false;
return true;
TypeIDValues.clear();
unsigned ID = 0;
- for (const LLTCodeGen LLTy : KnownTypes)
+ for (const LLTCodeGen &LLTy : KnownTypes)
TypeIDValues[LLTy] = ID++;
}
return false;
}
- for (const auto &Operand : zip(Operands, B.Operands)) {
+ for (auto Operand : zip(Operands, B.Operands)) {
if (std::get<0>(Operand)->isHigherPriorityThan(*std::get<1>(Operand)))
return true;
if (std::get<1>(Operand)->isHigherPriorityThan(*std::get<0>(Operand)))
if (Matchers.size() < B.Matchers.size())
return false;
- for (const auto &Matcher : zip(Matchers, B.Matchers)) {
+ for (auto Matcher : zip(Matchers, B.Matchers)) {
if (std::get<0>(Matcher)->isHigherPriorityThan(*std::get<1>(Matcher)))
return true;
if (std::get<1>(Matcher)->isHigherPriorityThan(*std::get<0>(Matcher)))
return true;
if (A.size() > B.size())
return false;
- for (const auto &Pair : zip(A, B)) {
+ for (auto Pair : zip(A, B)) {
if (std::get<0>(Pair)->getName() < std::get<1>(Pair)->getName())
return true;
if (std::get<0>(Pair)->getName() > std::get<1>(Pair)->getName())
OS << "bool ValuesWereAdded;\n";
OS << R.getValueAsString("ValuesCode");
OS << "\n";
- for (const std::string &Pref : R.getValueAsListOfStrings("Prefixes")) {
+ for (std::string S : R.getValueAsListOfStrings("Prefixes")) {
OS << "ValuesWereAdded = Opt.addValues(";
- std::string S = (Pref + R.getValueAsString("Name")).str();
+ S += R.getValueAsString("Name");
write_cstring(OS, S);
OS << ", Values);\n";
OS << "(void)ValuesWereAdded;\n";