[PATCH] D115061: [clang-format][NFC] Prefer pass by reference

Arthur O'Dwyer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 3 13:15:11 PST 2021


Quuxplusone added a comment.

FWLIW, I'm strongly in favor of "Pass out-parameters by pointer," for the reason Marek said (and the reason Google, Bloomberg, Facebook, Mongo, etc, do it) — it makes life easier for the reader of the calling code. Especially for e.g. `addNextStateToQueue(Penalty, Node, /*NewLine=*/false, Count, Queue)`, I don't think it's at all obvious that this is going to modify the value of `Count`!
But this isn't my code and I don't know what LLVM's house style is.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115061



More information about the cfe-commits mailing list