diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-06-18 07:44:41 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-06-18 07:44:41 +0000 |
| commit | 7e0dd2b11fa0fcb15cfec7982ade636f6415a916 (patch) | |
| tree | 60a8077f8f704a395240b7f0f402be1688359006 /clang/Lex/Lexer.cpp | |
| parent | 33ce7283ee667d76a714ea4419857b1ece10a4e8 (diff) | |
| download | bcm5719-llvm-7e0dd2b11fa0fcb15cfec7982ade636f6415a916.tar.gz bcm5719-llvm-7e0dd2b11fa0fcb15cfec7982ade636f6415a916.zip | |
Fix a fixme by passing language options into LexerToken::dump, instead of
relying on TheLexer.
llvm-svn: 38549
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 << "'"; |

