]> granicus.if.org Git - clang/commitdiff
simplify Preprocessor::getSpelling now that identifiers carry around
authorChris Lattner <sabre@nondot.org>
Mon, 5 Jan 2009 19:44:41 +0000 (19:44 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 5 Jan 2009 19:44:41 +0000 (19:44 +0000)
their length.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61734 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/Preprocessor.cpp

index aa2944f331d597ff6682aac9d85a36f5de716a63..1fe23216e71f432dd0aa97ba736217ec56980d27 100644 (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.