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

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 09:21:35 PDT 2016


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 ?


http://reviews.llvm.org/D20331





More information about the llvm-commits mailing list