]> granicus.if.org Git - clang/commitdiff
Teach Lexer::MeasureTokenLength to be able to measure the
authorChris Lattner <sabre@nondot.org>
Wed, 14 Oct 2009 15:04:18 +0000 (15:04 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 14 Oct 2009 15:04:18 +0000 (15:04 +0000)
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

lib/Lex/Lexer.cpp

index 0f01155a8f2c836df8434f33638b81b276c3d9ae..c8b9a5d5420ae9ef8dcbfa40b34546ae87074dc8 100644 (file)
@@ -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();