[lld] r265136 - Make dummySectionsNum() to be not a member of writer. NFC.

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 5 18:39:11 PDT 2016


On Fri, Apr 1, 2016 at 4:59 AM, George Rimar via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: grimar
> Date: Fri Apr  1 06:59:32 2016
> New Revision: 265136
>
> URL: http://llvm.org/viewvc/llvm-project?rev=265136&view=rev
> Log:
> Make dummySectionsNum() to be not a member of writer. NFC.
>
> Modified:
>     lld/trunk/ELF/Writer.cpp
>
> Modified: lld/trunk/ELF/Writer.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=265136&r1=265135&r2=265136&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/Writer.cpp (original)
> +++ lld/trunk/ELF/Writer.cpp Fri Apr  1 06:59:32 2016
> @@ -107,9 +107,6 @@ private:
>    unsigned getNumSections() const {
>      return OutputSections.size() + 1 - dummySectionsNum();
>    }
> -  // Usually there are 2 dummies sections: ELF header and program header.
> -  // Relocatable output does not require program headers to be created.
> -  unsigned dummySectionsNum() const { return Config->Relocatable ? 1 : 2;
> }
>
>    void addRelIpltSymbols();
>    void addStartEndSymbols();
> @@ -127,6 +124,10 @@ private:
>  };
>  } // anonymous namespace
>
> +// Usually there are 2 dummies sections: ELF header and program header.
> +// Relocatable output does not require program headers to be created.
> +unsigned dummySectionsNum() { return Config->Relocatable ? 1 : 2; }
> +
>

This should probably be called getNumDummySections or something so that it
complies with the coding standards:
http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly

-- Sean Silva


>  template <class ELFT> void elf::writeResult(SymbolTable<ELFT> *Symtab) {
>    typedef typename ELFT::uint uintX_t;
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160405/dddbb668/attachment.html>


More information about the llvm-commits mailing list