[lld] r232253 - [ELF] Change few static functions.

Shankar Easwaran shankare at codeaurora.org
Sat Mar 14 12:41:46 PDT 2015


On 3/14/2015 1:53 PM, David Blaikie wrote:
> On Fri, Mar 13, 2015 at 10:27 PM, Shankar Easwaran <shankare at codeaurora.org>
> wrote:
>
>> Author: shankare
>> Date: Sat Mar 14 00:27:01 2015
>> New Revision: 232253
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=232253&view=rev
>> Log:
>> [ELF] Change few static functions.
>>
>> Functions hasOutputSegment/maybeGetSOName doesnot need not be static.
>>
> If something doesn't access member state, it should probably remain a
> static function... it seems confusing to pass an unused parameter (even if
> it's the implicit 'this' parameter that's unused).
Thanks for pointing this out. Will revert this change.

>
>
>> Modified:
>>      lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h
>>      lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h?rev=232253&r1=232252&r2=232253&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h Sat Mar 14 00:27:01 2015
>> @@ -193,7 +193,7 @@ public:
>>
>>     /// \brief Returns true/false depending on whether the section has a
>> Output
>>     //         segment or not
>> -  static bool hasOutputSegment(Section<ELFT> *section);
>> +  bool hasOutputSegment(Section<ELFT> *section);
>>
>>     // Adds an atom to the section
>>     ErrorOr<const lld::AtomLayout *> addAtom(const Atom *atom) override;
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h?rev=232253&r1=232252&r2=232253&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h Sat Mar 14 00:27:01
>> 2015
>> @@ -146,7 +146,7 @@ protected:
>>     /// @}
>>
>>   private:
>> -  static StringRef maybeGetSOName(Node *node);
>> +  StringRef maybeGetSOName(Node *node);
>>   };
>>
>>
>>   //===----------------------------------------------------------------------===//
>> @@ -298,7 +298,7 @@ void OutputELFWriter<ELFT>::assignSectio
>>     _layout.assignFileOffsetsForMiscSections();
>>     for (auto sec : _layout.sections())
>>       if (auto section = dyn_cast<Section<ELFT>>(sec))
>> -      if (!DefaultLayout<ELFT>::hasOutputSegment(section))
>> +      if (!_layout.hasOutputSegment(section))
>>           _shdrtab->updateSection(section);
>>   }
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation




More information about the llvm-commits mailing list