aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Pragma.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-08 08:08:45 +0000
committerChris Lattner <sabre@nondot.org>2009-03-08 08:08:45 +0000
commit1fa495304c81e03f07f278a47b5efe9317104aab (patch)
treec972c7493bcaba9b9cb88f4df32ff6fc6018fd0d /lib/Lex/Pragma.cpp
parent6b5e4f0cc5672c7d5449db28d5ead94d32407cb2 (diff)
simplify some logic by making ScratchBuffer handle the application of trailing
\0's to created tokens instead of making all clients do it. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66373 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Pragma.cpp')
-rw-r--r--lib/Lex/Pragma.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp
index 73d36414ba..b4fb47cb31 100644
--- a/lib/Lex/Pragma.cpp
+++ b/lib/Lex/Pragma.cpp
@@ -141,9 +141,8 @@ void Preprocessor::Handle_Pragma(Token &Tok) {
// contents appear to have a space before them.
StrVal[0] = ' ';
- // Replace the terminating quote with a \n\0.
+ // Replace the terminating quote with a \n.
StrVal[StrVal.size()-1] = '\n';
- StrVal += '\0';
// Remove escaped quotes and escapes.
for (unsigned i = 0, e = StrVal.size(); i != e-1; ++i) {
@@ -165,8 +164,7 @@ void Preprocessor::Handle_Pragma(Token &Tok) {
// Make and enter a lexer object so that we lex and expand the tokens just
// like any others.
Lexer *TL = Lexer::Create_PragmaLexer(TokLoc, PragmaLoc, RParenLoc,
- // do not include the null in the count.
- StrVal.size()-1, *this);
+ StrVal.size(), *this);
EnterSourceFileWithLexer(TL, 0);