[PATCH] D80079: [clang-format] [NFC] isCpp() is inconsistently used to mean both C++ and Objective C, add language specific isXXX() functions

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 25 04:46:33 PDT 2020


sammccall added a comment.

In D80079#2049459 <https://reviews.llvm.org/D80079#2049459>, @MyDeveloperDay wrote:

> I feel like there might something of a concencus forming.. If I take the time to redo following the suggestions @sammccall do you think you could live with it?


Yeah, LGTM. The alignment of the existing name with clang wasn't as close as I thought anyway. Sorry about adding friction here.

I feel like `isCppOrObjC` doesn't cover the "essence" of the thing being tested. But it's hard to come up with a great name because it's not clear whether this essence is about C or about C++ (we don't distinguish, and the answer varies depending on callsite).
Actually `isCFamily` might be a better name here - it's short, decides this is about C but clearly includes the others too. But I'm bikeshedding now, I can live with the current or any other option.

Regarding helpers vs no helpers for the trivial cases: I'm personally not a fan but this is just a question of taste and at this point your opinion is more important I think.


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

https://reviews.llvm.org/D80079





More information about the cfe-commits mailing list