djasper added inline comments.

================
Comment at: lib/Format/ContinuationIndenter.h:270
+  // \c breakProtrudingToken.
+  bool LastBlockCommentWasBroken : 1;
+
----------------
We should be *very* careful when adding stuff to ParenState as every extra bit 
of data and every extra comparison can have substantial cost.

Here, specifically:


  - Make this more generic. This currently addresses a very specific use case 
(comment broken), whereas the action is probably always going to be the same 
(enforce break). I think we should call this "NoContinuation" or "NeedsNewline" 
or something.
  - This seems always to only relate to the previous token. So it can be always 
reset when the state is moved further.
  - As this always refers to the previous token, this can probably live in 
LineState instead of ParenState. That way, it has less runtime/space overhead.




https://reviews.llvm.org/D37695



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to