diff options
Diffstat (limited to 'clang/Lex/Lexer.cpp')
| -rw-r--r-- | clang/Lex/Lexer.cpp | 16 |
1 files changed, 4 insertions, 12 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 << "'"; |

