[PATCH] D43906: [clang-format] Improve detection of Objective-C block types

Ben Hamilton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 12 08:45:18 PDT 2018


benhamilton marked an inline comment as done.
benhamilton added inline comments.


================
Comment at: lib/Format/TokenAnnotator.cpp:210
 
-    bool MightBeFunctionType = !Contexts[Contexts.size() - 2].IsExpression;
-    bool ProbablyFunctionType = CurrentToken->isOneOf(tok::star, tok::amp);
+    bool MightBeFunctionOrObjCBlockType =
+        !Contexts[Contexts.size() - 2].IsExpression;
----------------
djasper wrote:
> I'd suggest to put a comment here saying that this is for both ObjC blocks and Function types, because they look very similar in nature (maybe giving examples) and then not actually rename the variables. To me, the long names make the code harder to read.
> 
> But if you feel strongly the other way, I'd be ok with it.
Restored old names and added comment.



Repository:
  rC Clang

https://reviews.llvm.org/D43906





More information about the cfe-commits mailing list