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
diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp
index 73d3641..b4fb47c 100644
--- a/lib/Lex/Pragma.cpp
+++ b/lib/Lex/Pragma.cpp
@@ -141,9 +141,8 @@
// 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 @@
// 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);