Skip to content

Commit

Permalink
[TableGen] Use range-based for loops. NFC
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256626 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
topperc committed Dec 30, 2015
1 parent e6b5023 commit 65438a7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions utils/TableGen/AsmMatcherEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -989,8 +989,8 @@ bool MatchableInfo::validate(StringRef CommentDelimiter, bool Hack) const {
// 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 +
Expand Down Expand Up @@ -2146,8 +2146,8 @@ static void emitIsSubclass(CodeGenTarget &Target,
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
Expand Down

0 comments on commit 65438a7

Please sign in to comment.