aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-05 19:44:41 +0000
committerChris Lattner <sabre@nondot.org>2009-01-05 19:44:41 +0000
commite1dccaefe2d44a9f83f8c3f087438a3297254cac (patch)
tree33be015a57c9eccb385bc52d363a884e7695fea0 /lib/Lex/Preprocessor.cpp
parent6b54bd160bc7524e9bfbd64bb7692e7cace5772d (diff)
simplify Preprocessor::getSpelling now that identifiers carry around
their length. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61734 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r--lib/Lex/Preprocessor.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp
index aa2944f331..1fe23216e7 100644
--- a/lib/Lex/Preprocessor.cpp
+++ b/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.