Remove getSymbolValue.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 3 Apr 2014 02:32:47 +0000 (02:32 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 3 Apr 2014 02:32:47 +0000 (02:32 +0000)
All existing users explicitly ask for an address or a file offset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205503 91177308-0d34-0410-b5e6-96231b3b80d8

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

index af2eb6826ee5ae6284e485ac064335c912f8ed1f..6ece1b4cd5066b839e266b22d6394f08f680e3f0 100644 (file)
@@ -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;
index 9bdee9f56946d8031fbd81e0a5d21af10a31762f..bbb09f63289938efe02c9a160eb9eb4109edd9ac 100644 (file)
@@ -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>::getSymbolSection(DataRefImpl Symb,
   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));
index acd391ba330ea0d99887964d28a263e9eb053f92..1a957d69513c4a5b893964af745cdc4e15e57243 100644 (file)
@@ -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;
index 1fdfbe81b2458d67e6d3f2173fa7c7384e5573b0..87c1763a255dafe282133c9c9d8ba168accebbf1 100644 (file)
@@ -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(SymbolRef::Type &Result) const {
   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);
index 43913e44857b4051da5ad1c6c0626add2ab6edca..cb3d478ff390ba0d058a7d09305f641d2a59f18c 100644 (file)
@@ -252,11 +252,6 @@ error_code COFFObjectFile::getSymbolSection(DataRefImpl Ref,
   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;
index 6955ef090ae73c0fe227b19c9a3d5c5e0d0dc919..24368df0f2a5e8fd669b4c30fa08438e9322fa59 100644 (file)
@@ -631,11 +631,6 @@ MachOObjectFile::getSymbolSection(DataRefImpl Symb,
   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++;
 }