[PATCH] D141134: [NFC] Only expose getXXXSize functions in TypeSize
Guillaume Chatelet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 6 07:21:06 PST 2023
gchatelet added inline comments.
================
Comment at: llvm/include/llvm/Support/TypeSize.h:319-322
+ // Make 'getKnownMinValue' / 'getFixedValue' private as they are exposed as
+ // 'getKnownMinValue' / 'getFixedValue' lower in this class.
+ constexpr ScalarTy getKnownMinValue() const { return UP::getKnownMinValue(); }
+ constexpr ScalarTy getFixedValue() const { return UP::getFixedValue(); }
----------------
sdesmalen wrote:
> gchatelet wrote:
> > sdesmalen wrote:
> > > They're both only used once below, so I think you can remove the private interface and just call the parent class' method directly?
> > I could but then the methods would still be visible. Another option is to mark the functions protected in `FixedOrScalableQuantity` and make them public only in `ElementCount`.
> Ah of course, I didn't realise they were inherited. In that case I'm happy with this approach, because for TypeSize we made a stylistic exception to have something called `getKnownMinSize`, whereas in other circumstances the default `getKnownMinValue` is appropriate.
I forgot that I could use `using` to make the functions private. It's better than redefining them.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141134/new/
https://reviews.llvm.org/D141134
More information about the llvm-commits
mailing list