[llvm] r242828 - Remove always null argument.
Rafael Espindola
rafael.espindola at gmail.com
Tue Jul 21 12:38:32 PDT 2015
Author: rafael
Date: Tue Jul 21 14:38:32 2015
New Revision: 242828
URL: http://llvm.org/viewvc/llvm-project?rev=242828&view=rev
Log:
Remove always null argument.
Modified:
llvm/trunk/include/llvm/Object/ELF.h
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
Modified: llvm/trunk/include/llvm/Object/ELF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELF.h?rev=242828&r1=242827&r2=242828&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELF.h (original)
+++ llvm/trunk/include/llvm/Object/ELF.h Tue Jul 21 14:38:32 2015
@@ -245,8 +245,7 @@ public:
ErrorOr<StringRef> getStringTableForSymtab(const Elf_Shdr &Section) const;
const char *getDynamicString(uintX_t Offset) const;
- ErrorOr<StringRef> getSymbolVersion(const Elf_Shdr *section,
- const Elf_Sym *Symb,
+ ErrorOr<StringRef> getSymbolVersion(const Elf_Sym *Symb,
bool &IsDefault) const;
void VerifyStrTab(const Elf_Shdr *sh) const;
@@ -904,40 +903,8 @@ ELFFile<ELFT>::getSectionName(const Elf_
}
template <class ELFT>
-ErrorOr<StringRef> ELFFile<ELFT>::getSymbolVersion(const Elf_Shdr *section,
- const Elf_Sym *symb,
+ErrorOr<StringRef> ELFFile<ELFT>::getSymbolVersion(const Elf_Sym *symb,
bool &IsDefault) const {
- StringRef StrTab;
- if (section) {
- ErrorOr<StringRef> StrTabOrErr = getStringTable(section);
- if (std::error_code EC = StrTabOrErr.getError())
- return EC;
- StrTab = *StrTabOrErr;
- }
- // Handle non-dynamic symbols.
- if (section != DotDynSymSec && section != nullptr) {
- // Non-dynamic symbols can have versions in their names
- // A name of the form 'foo at V1' indicates version 'V1', non-default.
- // A name of the form 'foo@@V2' indicates version 'V2', default version.
- ErrorOr<StringRef> SymName = symb->getName(StrTab);
- if (!SymName)
- return SymName;
- StringRef Name = *SymName;
- size_t atpos = Name.find('@');
- if (atpos == StringRef::npos) {
- IsDefault = false;
- return StringRef("");
- }
- ++atpos;
- if (atpos < Name.size() && Name[atpos] == '@') {
- IsDefault = true;
- ++atpos;
- } else {
- IsDefault = false;
- }
- return Name.substr(atpos);
- }
-
// This is a dynamic symbol. Look in the GNU symbol version table.
if (!dot_gnu_version_sec) {
// No version table.
Modified: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ELFDumper.cpp?rev=242828&r1=242827&r2=242828&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp Tue Jul 21 14:38:32 2015
@@ -134,8 +134,7 @@ static std::string getFullSymbolName(con
std::string FullSymbolName(SymbolName);
bool IsDefault;
- ErrorOr<StringRef> Version =
- Obj.getSymbolVersion(nullptr, &*Symbol, IsDefault);
+ ErrorOr<StringRef> Version = Obj.getSymbolVersion(&*Symbol, IsDefault);
if (Version) {
FullSymbolName += (IsDefault ? "@@" : "@");
FullSymbolName += *Version;
More information about the llvm-commits
mailing list