Refactor MacroInfo so range for loops can be used to iterate its tokens.

Differential Revision: http://reviews.llvm.org/D9079

llvm-svn: 236975
This commit is contained in:
Daniel Marjamaki
2015-05-11 08:25:54 +00:00
parent d3585dbd1a
commit ecb0e1bc60
2 changed files with 4 additions and 4 deletions

View File

@@ -64,12 +64,11 @@ static void PrintMacroDefinition(const IdentifierInfo &II, const MacroInfo &MI,
OS << ' ';
SmallString<128> SpellingBuffer;
for (MacroInfo::tokens_iterator I = MI.tokens_begin(), E = MI.tokens_end();
I != E; ++I) {
if (I->hasLeadingSpace())
for (const auto &T : MI.tokens()) {
if (T.hasLeadingSpace())
OS << ' ';
OS << PP.getSpelling(*I, SpellingBuffer);
OS << PP.getSpelling(T, SpellingBuffer);
}
}