REPOSITORY
rL LLVM
http://reviews.llvm.org/D9079
Files:
cfe/trunk/include/clang/Lex/MacroInfo.h
cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp
Index: cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp
===================================================================
--- cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp
+++ cfe/trunk/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);
}
}
Index: cfe/trunk/include/clang/Lex/MacroInfo.h
===================================================================
--- cfe/trunk/include/clang/Lex/MacroInfo.h
+++ cfe/trunk/include/clang/Lex/MacroInfo.h
@@ -245,6 +245,7 @@
tokens_iterator tokens_begin() const { return ReplacementTokens.begin(); }
tokens_iterator tokens_end() const { return ReplacementTokens.end(); }
bool tokens_empty() const { return ReplacementTokens.empty(); }
+ ArrayRef<Token> tokens() const { return ReplacementTokens; }
/// \brief Add the specified token to the replacement text for the macro.
void AddTokenToBody(const Token &Tok) {
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
Index: cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp
===================================================================
--- cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp
+++ cfe/trunk/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);
}
}
Index: cfe/trunk/include/clang/Lex/MacroInfo.h
===================================================================
--- cfe/trunk/include/clang/Lex/MacroInfo.h
+++ cfe/trunk/include/clang/Lex/MacroInfo.h
@@ -245,6 +245,7 @@
tokens_iterator tokens_begin() const { return ReplacementTokens.begin(); }
tokens_iterator tokens_end() const { return ReplacementTokens.end(); }
bool tokens_empty() const { return ReplacementTokens.empty(); }
+ ArrayRef<Token> tokens() const { return ReplacementTokens; }
/// \brief Add the specified token to the replacement text for the macro.
void AddTokenToBody(const Token &Tok) {
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits