summaryrefslogtreecommitdiffstats
path: root/clang/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
commit2d49c4f98de60b11ff56a6ae6399162f1aaa2db8 (patch)
treebae7d8b33eedc2993368f544aa5f4a452fe17596 /clang/lib/Lex/TokenLexer.cpp
parent4486da5b78b47dc3c947ceb634d13a3d0ff0889e (diff)
downloadbcm5719-llvm-2d49c4f98de60b11ff56a6ae6399162f1aaa2db8.tar.gz
bcm5719-llvm-2d49c4f98de60b11ff56a6ae6399162f1aaa2db8.zip
Make sure an invalid concatentaion doesn't insert whitespace before
the RHS. Fixes assembler-with-cpp issue reported on cfe-dev. llvm-svn: 72370
Diffstat (limited to 'clang/lib/Lex/TokenLexer.cpp')
-rw-r--r--clang/lib/Lex/TokenLexer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Lex/TokenLexer.cpp b/clang/lib/Lex/TokenLexer.cpp
index f1af42aea51..65d083dffdc 100644
--- a/clang/lib/Lex/TokenLexer.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud