[lld] r297850 - [ELF] - Linkerscript: make Dot public and remove getDot(). NFC.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 17:00:45 PDT 2017


Rui Ueyama via llvm-commits <llvm-commits at lists.llvm.org> writes:

> I reverted the change since that was made based on a miscommunciation.
>
> So if we have a setter and a getter that don't do anything particularly
> useful such as
>
>   T getFoo() { return Foo; }
>   void setFoo(T Val) { Foo = Val; }
>
> then it makes sense to remove them, but in this case we have a fairly
> complicated `setDot` function, and we always set Dot via that function. So
> getDot works as a guard to protect the direct access to that variable.

Makes perfect sense. Have both a getter and a setter or neither is
probably a good rule of the thumb.

Thanks,
Rafael



More information about the llvm-commits mailing list