[llvm] r256626 - [TableGen] Use range-based for loops. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 29 22:00:20 PST 2015
Author: ctopper
Date: Wed Dec 30 00:00:20 2015
New Revision: 256626
URL: http://llvm.org/viewvc/llvm-project?rev=256626&view=rev
Log:
[TableGen] Use range-based for loops. NFC
Modified:
llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=256626&r1=256625&r2=256626&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Wed Dec 30 00:00:20 2015
@@ -989,8 +989,8 @@ bool MatchableInfo::validate(StringRef C
// Also, check for instructions which reference the operand multiple times;
// this implies a constraint we would not honor.
std::set<std::string> OperandNames;
- for (unsigned i = 0, e = AsmOperands.size(); i != e; ++i) {
- StringRef Tok = AsmOperands[i].Token;
+ for (const AsmOperand &Op : AsmOperands) {
+ StringRef Tok = Op.Token;
if (Tok[0] == '$' && Tok.find(':') != StringRef::npos)
PrintFatalError(TheDef->getLoc(),
"matchable with operand modifier '" + Tok +
@@ -2146,8 +2146,8 @@ static void emitIsSubclass(CodeGenTarget
if (!SuperClasses.empty()) {
SS << " switch (B) {\n";
SS << " default: return false;\n";
- for (unsigned i = 0, e = SuperClasses.size(); i != e; ++i)
- SS << " case " << SuperClasses[i].str() << ": return true;\n";
+ for (StringRef SC : SuperClasses)
+ SS << " case " << SC << ": return true;\n";
SS << " }\n";
} else {
// No case statement to emit
More information about the llvm-commits
mailing list