[llvm] r205503 - Remove getSymbolValue.

Rafael Espindola rafael.espindola at gmail.com
Wed Apr 2 19:32:47 PDT 2014


Author: rafael
Date: Wed Apr  2 21:32:47 2014
New Revision: 205503

URL: http://llvm.org/viewvc/llvm-project?rev=205503&view=rev
Log:
Remove getSymbolValue.

All existing users explicitly ask for an address or a file offset.

Modified:
    llvm/trunk/include/llvm/Object/COFF.h
    llvm/trunk/include/llvm/Object/ELFObjectFile.h
    llvm/trunk/include/llvm/Object/MachO.h
    llvm/trunk/include/llvm/Object/ObjectFile.h
    llvm/trunk/lib/Object/COFFObjectFile.cpp
    llvm/trunk/lib/Object/MachOObjectFile.cpp

Modified: llvm/trunk/include/llvm/Object/COFF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/COFF.h?rev=205503&r1=205502&r2=205503&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/COFF.h (original)
+++ llvm/trunk/include/llvm/Object/COFF.h Wed Apr  2 21:32:47 2014
@@ -371,7 +371,6 @@ protected:
                            SymbolRef::Type &Res) const override;
   error_code getSymbolSection(DataRefImpl Symb,
                               section_iterator &Res) const override;
-  error_code getSymbolValue(DataRefImpl Symb, uint64_t &Val) const override;
   void moveSectionNext(DataRefImpl &Sec) const override;
   error_code getSectionName(DataRefImpl Sec, StringRef &Res) const override;
   error_code getSectionAddress(DataRefImpl Sec, uint64_t &Res) const override;

Modified: llvm/trunk/include/llvm/Object/ELFObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELFObjectFile.h?rev=205503&r1=205502&r2=205503&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELFObjectFile.h (original)
+++ llvm/trunk/include/llvm/Object/ELFObjectFile.h Wed Apr  2 21:32:47 2014
@@ -68,7 +68,6 @@ protected:
                            SymbolRef::Type &Res) const override;
   error_code getSymbolSection(DataRefImpl Symb,
                               section_iterator &Res) const override;
-  error_code getSymbolValue(DataRefImpl Symb, uint64_t &Val) const override;
 
   error_code getLibraryNext(DataRefImpl Data,
                             LibraryRef &Result) const override;
@@ -395,14 +394,6 @@ error_code ELFObjectFile<ELFT>::getSymbo
   return object_error::success;
 }
 
-template <class ELFT>
-error_code ELFObjectFile<ELFT>::getSymbolValue(DataRefImpl Symb,
-                                               uint64_t &Val) const {
-  const Elf_Sym *ESym = getSymbol(Symb);
-  Val = ESym->st_value;
-  return object_error::success;
-}
-
 template <class ELFT>
 void ELFObjectFile<ELFT>::moveSectionNext(DataRefImpl &Sec) const {
   Sec = toDRI(++toELFShdrIter(Sec));

Modified: llvm/trunk/include/llvm/Object/MachO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/MachO.h?rev=205503&r1=205502&r2=205503&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/MachO.h (original)
+++ llvm/trunk/include/llvm/Object/MachO.h Wed Apr  2 21:32:47 2014
@@ -71,7 +71,6 @@ public:
   uint32_t getSymbolFlags(DataRefImpl Symb) const override;
   error_code getSymbolSection(DataRefImpl Symb,
                               section_iterator &Res) const override;
-  error_code getSymbolValue(DataRefImpl Symb, uint64_t &Val) const override;
 
   void moveSectionNext(DataRefImpl &Sec) const override;
   error_code getSectionName(DataRefImpl Sec, StringRef &Res) const override;

Modified: llvm/trunk/include/llvm/Object/ObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ObjectFile.h?rev=205503&r1=205502&r2=205503&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ObjectFile.h (original)
+++ llvm/trunk/include/llvm/Object/ObjectFile.h Wed Apr  2 21:32:47 2014
@@ -156,9 +156,6 @@ public:
   /// end_sections() if it is undefined or is an absolute symbol.
   error_code getSection(section_iterator &Result) const;
 
-  /// @brief Get value of the symbol in the symbol table.
-  error_code getValue(uint64_t &Val) const;
-
   const ObjectFile *getObject() const;
 };
 
@@ -238,7 +235,6 @@ protected:
                                    SymbolRef::Type &Res) const = 0;
   virtual error_code getSymbolSection(DataRefImpl Symb,
                                       section_iterator &Res) const = 0;
-  virtual error_code getSymbolValue(DataRefImpl Symb, uint64_t &Val) const = 0;
 
   // Same as above for SectionRef.
   friend class SectionRef;
@@ -375,10 +371,6 @@ inline error_code SymbolRef::getType(Sym
   return getObject()->getSymbolType(getRawDataRefImpl(), Result);
 }
 
-inline error_code SymbolRef::getValue(uint64_t &Val) const {
-  return getObject()->getSymbolValue(getRawDataRefImpl(), Val);
-}
-
 inline const ObjectFile *SymbolRef::getObject() const {
   const SymbolicFile *O = BasicSymbolRef::getObject();
   return cast<ObjectFile>(O);

Modified: llvm/trunk/lib/Object/COFFObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/COFFObjectFile.cpp?rev=205503&r1=205502&r2=205503&view=diff
==============================================================================
--- llvm/trunk/lib/Object/COFFObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/COFFObjectFile.cpp Wed Apr  2 21:32:47 2014
@@ -252,11 +252,6 @@ error_code COFFObjectFile::getSymbolSect
   return object_error::success;
 }
 
-error_code COFFObjectFile::getSymbolValue(DataRefImpl Ref,
-                                          uint64_t &Val) const {
-  report_fatal_error("getSymbolValue unimplemented in COFFObjectFile");
-}
-
 void COFFObjectFile::moveSectionNext(DataRefImpl &Ref) const {
   const coff_section *Sec = toSec(Ref);
   Sec += 1;

Modified: llvm/trunk/lib/Object/MachOObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/MachOObjectFile.cpp?rev=205503&r1=205502&r2=205503&view=diff
==============================================================================
--- llvm/trunk/lib/Object/MachOObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/MachOObjectFile.cpp Wed Apr  2 21:32:47 2014
@@ -631,11 +631,6 @@ MachOObjectFile::getSymbolSection(DataRe
   return object_error::success;
 }
 
-error_code MachOObjectFile::getSymbolValue(DataRefImpl Symb,
-                                           uint64_t &Val) const {
-  report_fatal_error("getSymbolValue unimplemented in MachOObjectFile");
-}
-
 void MachOObjectFile::moveSectionNext(DataRefImpl &Sec) const {
   Sec.d.a++;
 }





More information about the llvm-commits mailing list