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

Owen Pan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 7 23:52:57 PDT 2019


owenpan requested changes to this revision.
owenpan added inline comments.
This revision now requires changes to proceed.


================
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.Previous->Previous->is(tok::hash))
----------------
I think it can be more precise and simplified to something like this:
```
  if (Left.Previous && Left.Previous->is(tok::pp_define) &&
      Left.isNot(tok::identifier) && Right.is(tok::l_paren))
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60362/new/

https://reviews.llvm.org/D60362





More information about the llvm-commits mailing list