[PATCH] Whitespace issues during preprocessing

Harald van Dijk harald at gigawatt.nl
Sat Feb 1 11:09:47 PST 2014


Hi all,

Attached are my updated patches intended to fix various whitespace
issues in clang, modified to take Justin Bogner's comments into account.
They are intended to ensure that whitespace is not inappropriately
removed just because a macro or macro argument expansion is empty, and
does get removed during token pasting.

I have moved the handling of invalid token pastes from
TokenLexer::ExpandFunctionArguments to TokenLexer::Lex, so that it works
for both object- and function-like macros, and both when ##'s operands
use macro parameters and when they don't.

Do these changes look okay now? If so, would someone be so kind as to
commit them for me?

Cheers,
Harald van Dijk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-whitespace-handling-in-operator.patch
Type: text/x-patch
Size: 5795 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140201/390a7a40/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Fix-whitespace-handling-in-empty-macro-arguments.patch
Type: text/x-patch
Size: 7311 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140201/390a7a40/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Fix-whitespace-handling-in-empty-macro-expansions.patch
Type: text/x-patch
Size: 2521 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140201/390a7a40/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Clean-up-whitespace-checks.patch
Type: text/x-patch
Size: 3173 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140201/390a7a40/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Fix-handling-of-whitespace-in-invalid-token-pastes.patch
Type: text/x-patch
Size: 3078 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140201/390a7a40/attachment-0004.bin>


More information about the cfe-commits mailing list