summaryrefslogtreecommitdiffstats
path: root/lib/Lex/TokenLexer.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-05-24 19:25:46 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-05-24 19:25:46 +0000
commit4c3ba6c1944e6a4758f1b3a0aec8a7ff4c561051 (patch)
tree38d07b1e3b59383acb0c12b42eacb61fe0df0319 /lib/Lex/TokenLexer.cpp
parentce9f4966bcfa404dbf1a7fddfb1f2f2c61b7629f (diff)
Make sure an invalid concatentaion doesn't insert whitespace before
the RHS. Fixes assembler-with-cpp issue reported on cfe-dev. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72370 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/TokenLexer.cpp')
-rw-r--r--lib/Lex/TokenLexer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Lex/TokenLexer.cpp b/lib/Lex/TokenLexer.cpp
index f1af42aea5..65d083dffd 100644
--- a/lib/Lex/TokenLexer.cpp
+++ b/lib/Lex/TokenLexer.cpp
@@ -223,7 +223,11 @@ void TokenLexer::ExpandFunctionArguments() {
// If the next token was supposed to get leading whitespace, ensure it has
// it now.
if (CurTok.hasLeadingSpace() || NextTokGetsSpace) {
- ResultToks[ResultToks.size()-NumToks].setFlag(Token::LeadingSpace);
+ // Exception: the RHS of a paste doesn't get whitespace. This allows
+ // constructs like conacatenating a period and an identifer to work
+ // correctly in assembler-with-cpp.
+ if (!PasteBefore)
+ ResultToks[ResultToks.size()-NumToks].setFlag(Token::LeadingSpace);
NextTokGetsSpace = false;
}
continue;