[PATCH] D62478: [LV] Wrap LV illegality reporting in a function. NFC.
Renato Golin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 28 10:53:44 PDT 2019
rengolin added a comment.
In D62478#1518679 <https://reviews.llvm.org/D62478#1518679>, @psamolysov wrote:
> I don't understand why having a function with a lot of arguments is better than a private method getting access to the class' members. Why are private methods in C++ at all, they also are used only from class methods and can be replaced with static util functions getting required class members as arguments.
For reference, this is not about access or class size, but bloat in the header for functionality that is internal to the cpp file. This is a common pattern in LLVM and developers know what to expect.
It's a pattern which conveys the idea that the functionality is orthogonal to the class' intention (which this is, just error reporting) and so not really belongs to the class itself.
Furthermore, the method already has a lot of arguments, this would only be adding one new one, so not a great difference.
--renato
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62478/new/
https://reviews.llvm.org/D62478
More information about the llvm-commits
mailing list