diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-05 19:44:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-05 19:44:41 +0000 |
commit | 07ebf302e5086323ddaf824427606d67ffe3b112 (patch) | |
tree | 10cc231cc725b8fb801aa5f109c00695005867d2 /clang/lib/Lex/Preprocessor.cpp | |
parent | dbc6c31f620d5b87116408d7328d8b88b884e43d (diff) | |
download | bcm5719-llvm-07ebf302e5086323ddaf824427606d67ffe3b112.tar.gz bcm5719-llvm-07ebf302e5086323ddaf824427606d67ffe3b112.zip |
simplify Preprocessor::getSpelling now that identifiers carry around
their length.
llvm-svn: 61734
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r-- | clang/lib/Lex/Preprocessor.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index aa2944f331d..1fe23216e71 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -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. |