diff options
author | Daniel Marjamaki <daniel.marjamaki@evidente.se> | 2015-05-11 08:25:54 +0000 |
---|---|---|
committer | Daniel Marjamaki <daniel.marjamaki@evidente.se> | 2015-05-11 08:25:54 +0000 |
commit | ecb0e1bc6093d0a5087b2ff57e99059aeb3edfee (patch) | |
tree | 1092d571a61d67f2769f5ce6d579df69e9a2a44a /clang/lib/Frontend/PrintPreprocessedOutput.cpp | |
parent | d3585dbd1abef83b4aa922c814a637fc38d4e1b2 (diff) | |
download | bcm5719-llvm-ecb0e1bc6093d0a5087b2ff57e99059aeb3edfee.tar.gz bcm5719-llvm-ecb0e1bc6093d0a5087b2ff57e99059aeb3edfee.zip |
Refactor MacroInfo so range for loops can be used to iterate its tokens.
Differential Revision: http://reviews.llvm.org/D9079
llvm-svn: 236975
Diffstat (limited to 'clang/lib/Frontend/PrintPreprocessedOutput.cpp')
-rw-r--r-- | clang/lib/Frontend/PrintPreprocessedOutput.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp index 8ca36489ee4..037a6a525e2 100644 --- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp +++ b/clang/lib/Frontend/PrintPreprocessedOutput.cpp @@ -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); } } |