[lld] r175207 - [ELF][Writer] Refactor Section to not have atoms. Move atoms into AtomSection.

Dmitri Gribenko gribozavr at gmail.com
Tue Mar 5 05:52:32 PST 2013


On Thu, Feb 14, 2013 at 10:24 PM, Michael J. Spencer
<bigcheesegs at gmail.com> wrote:
> --- lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h (original)
> +++ lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h Thu Feb 14 14:24:38 2013
> @@ -31,42 +31,122 @@
>
>  namespace lld {
>  namespace elf {
> +using namespace llvm::ELF;
>
> -/// \brief A section contains a set of atoms that have similiar properties
> -///        The atoms that have similiar properties are merged to form a section
> -template<class ELFT>
> -class Section : public Chunk<ELFT> {
> +/// \brief An ELF section.
> +template <class ELFT> class Section : public Chunk<ELFT> {
>  public:
> -  // The Kind of section that the object represents
> -  enum SectionKind {
> -    K_Default,
> -    K_Target, // The section is handed over to the target
> -    K_SymbolTable,
> -    K_StringTable,
> -  };
> -  // Create a section object, the section is set to the default type if the
> -  // caller doesnot set it
> -  Section(const ELFTargetInfo &, StringRef sectionName,
> -          const int32_t contentType, const int32_t contentPermissions,
> -          const int32_t order, const SectionKind kind = K_Default);
> -
> -  /// return the section kind
> -  inline SectionKind sectionKind() const {
> -    return _sectionKind;
> -  }
> -
> -  /// set the section Kind, this function is needed by the targetHandler
> -  /// to set the target section
> -  inline void setKind(SectionKind k) { _sectionKind = k; }
> +  /// \param type the ELF SHT_* type of the section.
> +  Section(const ELFTargetInfo &ti, StringRef name,
> +          typename Chunk<ELFT>::Kind k = Chunk<ELFT>::K_ELFSection)

Hello Michael,

Sorry to comment on an old commit, but this comment triggers a warning:

tools/lld/lib/ReaderWriter/ELF/SectionChunks.h:49:14: warning:
parameter 'type' not found in the function declaration
[-Wdocumentation]
  /// \param type the ELF SHT_* type of the section.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the llvm-commits mailing list