[PATCH] D43661: [llvm-objcopy] Fix typo in setSymTab and make setters private.

Alexander Shaposhnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 17:12:54 PST 2018


alexshap created this revision.
alexshap added reviewers: jakehehrlich, jhenderson.

[NFC] This diff fixes the name of the argument of setSymTab and makes setSymTab/setStrTab private
(to make the public interface a bit cleaner).
(to be honest, I'm not sure if these methods provide any value at all, I would probably remove them, but it's not particularly important)
P.S. I've been working on some other fixes to llvm-objcopy (will create a code review soon), but this tiny change is unrelated that's why I decided to send a separate diff.


Repository:
  rL LLVM

https://reviews.llvm.org/D43661

Files:
  Object.h


Index: Object.h
===================================================================
--- Object.h
+++ Object.h
@@ -343,14 +343,15 @@
 class SymbolTableSection : public SectionBase {
   MAKE_SEC_WRITER_FRIEND
 
+  void setStrTab(StringTableSection *StrTab) { SymbolNames = StrTab; }
+
 protected:
   std::vector<std::unique_ptr<Symbol>> Symbols;
   StringTableSection *SymbolNames = nullptr;
 
   using SymPtr = std::unique_ptr<Symbol>;
 
 public:
-  void setStrTab(StringTableSection *StrTab) { SymbolNames = StrTab; }
   void addSymbol(StringRef Name, uint8_t Bind, uint8_t Type,
                  SectionBase *DefinedIn, uint64_t Value, uint8_t Visibility,
                  uint16_t Shndx, uint64_t Sz);
@@ -403,12 +404,12 @@
 class RelocSectionWithSymtabBase : public RelocationSectionBase {
 private:
   SymTabType *Symbols = nullptr;
+  void setSymTab(SymTabType *SymTab) { Symbols = SymTab; }
 
 protected:
   RelocSectionWithSymtabBase() = default;
 
 public:
-  void setSymTab(SymTabType *StrTab) { Symbols = StrTab; }
   void removeSectionReferences(const SectionBase *Sec) override;
   void initialize(SectionTableRef SecTable) override;
   void finalize() override;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43661.135566.patch
Type: text/x-patch
Size: 1177 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180223/2f42e626/attachment.bin>


More information about the llvm-commits mailing list