diff options
Diffstat (limited to 'clang/Lex')
| -rw-r--r-- | clang/Lex/Lexer.cpp | 16 | ||||
| -rw-r--r-- | clang/Lex/MacroInfo.cpp | 4 |
2 files changed, 6 insertions, 14 deletions
diff --git a/clang/Lex/Lexer.cpp b/clang/Lex/Lexer.cpp index fac724529fc..eaf5ff099fb 100644 --- a/clang/Lex/Lexer.cpp +++ b/clang/Lex/Lexer.cpp @@ -75,20 +75,12 @@ SourceLocation LexerToken::getSourceLocation() const { /// dump - Print the token to stderr, used for debugging. /// -void LexerToken::dump(bool DumpFlags) const { +void LexerToken::dump(const LangOptions &Features, bool DumpFlags) const { std::cerr << clang::tok::getTokenName(Kind) << " '"; - if (needsCleaning()) { - if (getLexer()) - std::cerr << getLexer()->getSpelling(*this); - else { - // FIXME: expansion from macros clears location info. Testcase: - // #define TWELVE 1\ <whitespace only> - // 2 - // TWELVE - std::cerr << "*unspelled*" << std::string(getStart(), getEnd()); - } - } else + if (needsCleaning()) + std::cerr << Lexer::getSpelling(*this, Features); + else std::cerr << std::string(getStart(), getEnd()); std::cerr << "'"; diff --git a/clang/Lex/MacroInfo.cpp b/clang/Lex/MacroInfo.cpp index cd5895ab932..267325bf8f3 100644 --- a/clang/Lex/MacroInfo.cpp +++ b/clang/Lex/MacroInfo.cpp @@ -18,10 +18,10 @@ using namespace clang; /// dump - Print the macro to stderr, used for debugging. /// -void MacroInfo::dump() const { +void MacroInfo::dump(const LangOptions &Features) const { std::cerr << "MACRO: "; for (unsigned i = 0, e = ReplacementTokens.size(); i != e; ++i) { - ReplacementTokens[i].dump(); + ReplacementTokens[i].dump(Features); std::cerr << " "; } std::cerr << "\n"; |

