[PATCH] D20331: [llvm-mc] - Teach llvm-mc to generate compressed debug sections in zlib style.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 09:37:22 PDT 2016


On 17 May 2016 at 12:21, George Rimar <grimar at accesssoftek.com> wrote:
> grimar added inline comments.
>
> ================
> Comment at: lib/MC/MCSectionELF.cpp:164
> @@ -165,4 +163,2 @@
>
> -bool MCSectionELF::isVirtualSection() const {
> -  return getType() == ELF::SHT_NOBITS;
> -}
> +bool MCSectionELF::isVirtualSection() const { return Flags == ELF::SHT_NOBITS; }
> ----------------
> davide wrote:
>> Why did you change from `getType()` to `Flags`. Also, why can't you use the getter as they were used before?
> I made Flags public because I need to add SHF_COMPRESSED flag to it.
> In lld if we use the variable directly like I did, we do not using getters setters anymore, because there is no sense.
> getters/setters are only useful if can protect something, but if you need and use both of them, then probably you do not need any of in fact. So public variable is better here.
> I am not sure about style in any other project that lld, I had no real expirience in changing anything aside yet, but I guess it should be the same ?

Maybe. I would still suggest just keeping the getter for this patch as
it makes it easier to read (less unrelated changes).

Cheers,
Rafael


More information about the llvm-commits mailing list