Refactor MacroInfo so range for loops can be used to iterate its tokens.
Differential Revision: http://reviews.llvm.org/D9079
llvm-svn: 236975
diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp
index 8ca3648..037a6a5 100644
--- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp
+++ b/clang/lib/Frontend/PrintPreprocessedOutput.cpp
@@ -64,12 +64,11 @@
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);
}
}