aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Lexer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-14 15:04:18 +0000
committerChris Lattner <sabre@nondot.org>2009-10-14 15:04:18 +0000
commit39de7409bffb6b725a8aa64f0ba77ab51e8c9eb3 (patch)
treee1568d25497d44f1cd9314ea093354717f44b301 /lib/Lex/Lexer.cpp
parent491b84c062ead1c69911a8d5f0d57826afacc099 (diff)
Teach Lexer::MeasureTokenLength to be able to measure the
length of comment tokens. Patch by Abramo Bagnara! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84100 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Lexer.cpp')
-rw-r--r--lib/Lex/Lexer.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp
index 0f01155a8f..c8b9a5d542 100644
--- a/lib/Lex/Lexer.cpp
+++ b/lib/Lex/Lexer.cpp
@@ -238,6 +238,7 @@ unsigned Lexer::MeasureTokenLength(SourceLocation Loc,
// Create a lexer starting at the beginning of this token.
Lexer TheLexer(Loc, LangOpts, Buffer.first, StrData, Buffer.second);
+ TheLexer.SetCommentRetentionState(true);
Token TheTok;
TheLexer.LexFromRawLexer(TheTok);
return TheTok.getLength();