[cfe-commits] r40410 - /cfe/trunk/Lex/Preprocessor.cpp
Chris Lattner
sabre at nondot.org
Sun Jul 22 15:50:09 PDT 2007
Author: lattner
Date: Sun Jul 22 17:50:09 2007
New Revision: 40410
URL: http://llvm.org/viewvc/llvm-project?rev=40410&view=rev
Log:
fix a bug getting the spelling of an identifier token
that required cleaning. If the token required cleaning,
don't include the cleaned tokens in the returned length.
Modified:
cfe/trunk/Lex/Preprocessor.cpp
Modified: cfe/trunk/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Lex/Preprocessor.cpp?rev=40410&r1=40409&r2=40410&view=diff
==============================================================================
--- cfe/trunk/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/Lex/Preprocessor.cpp Sun Jul 22 17:50:09 2007
@@ -217,7 +217,13 @@
// table, which is very quick.
if (const IdentifierInfo *II = Tok.getIdentifierInfo()) {
Buffer = II->getName();
- return Tok.getLength();
+
+ // Return the length of the token. If the token needed cleaning, don't
+ // include the size of the newlines or trigraphs in it.
+ if (!Tok.needsCleaning())
+ return Tok.getLength();
+ else
+ return strlen(Buffer);
}
// Otherwise, compute the start of the token in the input lexer buffer.
More information about the cfe-commits
mailing list