diff options
author | Chris Lattner <sabre@nondot.org> | 2006-07-19 05:45:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-07-19 05:45:55 +0000 |
commit | e8dcfef324eb7240381ba9116f21da22fa4fef73 (patch) | |
tree | 5e6f1d9e1c5dddec7e23ef2f72114c207fdcb4cb /clang/Lex/MacroExpander.cpp | |
parent | 01ecf835c2f6f81c1cad2cf8f6320daeff8b162f (diff) | |
download | bcm5719-llvm-e8dcfef324eb7240381ba9116f21da22fa4fef73.tar.gz bcm5719-llvm-e8dcfef324eb7240381ba9116f21da22fa4fef73.zip |
Fix test/Preprocessor/macro_paste_spacing.c
llvm-svn: 38734
Diffstat (limited to 'clang/Lex/MacroExpander.cpp')
-rw-r--r-- | clang/Lex/MacroExpander.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/Lex/MacroExpander.cpp b/clang/Lex/MacroExpander.cpp index 7d28de546a1..ece0d095085 100644 --- a/clang/Lex/MacroExpander.cpp +++ b/clang/Lex/MacroExpander.cpp @@ -372,6 +372,10 @@ void MacroExpander::Lex(LexerToken &Tok) { return PPCache.Lex(Tok); } + // If this is the first token of the expanded result, we inherit spacing + // properties later. + bool isFirstToken = CurToken == 0; + // Get the next token to return. Tok = (*MacroTokens)[CurToken++]; @@ -395,7 +399,7 @@ void MacroExpander::Lex(LexerToken &Tok) { // If this is the first token, set the lexical properties of the token to // match the lexical properties of the macro identifier. - if (CurToken == 1) { + if (isFirstToken) { Tok.SetFlagValue(LexerToken::StartOfLine , AtStartOfLine); Tok.SetFlagValue(LexerToken::LeadingSpace, HasLeadingSpace); } |