[PATCH] D60362: [clang-format] [PR39719] clang-format converting object-like macro to function-like macro

2019-04-18 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay abandoned this revision. MyDeveloperDay added a comment. Abandoning in favor of D60853: clang-format converts a keyword macro definition to a macro function Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60362/new/

[PATCH] D60362: [clang-format] [PR39719] clang-format converting object-like macro to function-like macro

2019-04-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Actually, there is a neater way: https://reviews.llvm.org/D60853 Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60362/new/ https://reviews.llvm.org/D60362 ___ cfe-commits mailing list cfe-comm

[PATCH] D60362: [clang-format] [PR39719] clang-format converting object-like macro to function-like macro

2019-04-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. A more straightforward way, IMO, is to add to the `spaceRequiredBetween` function a separate `if` statement that returns false for the sequence of tokens: `#`, `define`, tok::identifier, and `(` Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D60362: [clang-format] [PR39719] clang-format converting object-like macro to function-like macro

2019-04-17 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. @klimek one possible solution to this might be to replace the "keyword" back to an identifier in a '#define ' scenario Maybe something like this? bool FormatTokenLexer::tryConvertKeyWordDefines() { // ensure #define keyword x = tok::hash,tok::identifier,to

[PATCH] D60362: [clang-format] [PR39719] clang-format converting object-like macro to function-like macro

2019-04-08 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:2467-2470 + if (Line.InPPDirective && Right.is(tok::l_paren) && + !Left.is(tok::identifier) && Left.Previous && + Left.Previous->is(tok::identifier) && Left.Previous->Previous && + Left.