simplify Preprocessor::getSpelling now that identifiers carry around

their length.

llvm-svn: 61734
This commit is contained in:
Chris Lattner
2009-01-05 19:44:41 +00:00
parent dbc6c31f62
commit 07ebf302e5

View File

@@ -234,13 +234,7 @@ unsigned Preprocessor::getSpelling(const Token &Tok,
// table, which is very quick.
if (const IdentifierInfo *II = Tok.getIdentifierInfo()) {
Buffer = II->getName();
// 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);
return II->getLength();
}
// Otherwise, compute the start of the token in the input lexer buffer.