[PATCH] D54627: [ELF] - Make SymbolTable::addDefined return Defined.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 22 03:43:14 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL347455: [ELF] - Make SymbolTable::addDefined return Defined. (authored by grimar, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D54627?vs=174353&id=175034#toc
Repository:
rL LLVM
https://reviews.llvm.org/D54627
Files:
lld/trunk/ELF/SymbolTable.cpp
lld/trunk/ELF/SymbolTable.h
lld/trunk/ELF/Writer.cpp
Index: lld/trunk/ELF/SymbolTable.cpp
===================================================================
--- lld/trunk/ELF/SymbolTable.cpp
+++ lld/trunk/ELF/SymbolTable.cpp
@@ -459,9 +459,9 @@
error(Msg);
}
-Symbol *SymbolTable::addDefined(StringRef Name, uint8_t StOther, uint8_t Type,
- uint64_t Value, uint64_t Size, uint8_t Binding,
- SectionBase *Section, InputFile *File) {
+Defined *SymbolTable::addDefined(StringRef Name, uint8_t StOther, uint8_t Type,
+ uint64_t Value, uint64_t Size, uint8_t Binding,
+ SectionBase *Section, InputFile *File) {
Symbol *S;
bool WasInserted;
std::tie(S, WasInserted) = insert(Name, getVisibility(StOther),
@@ -474,7 +474,7 @@
else if (Cmp == 0)
reportDuplicate(S, File, dyn_cast_or_null<InputSectionBase>(Section),
Value);
- return S;
+ return cast<Defined>(S);
}
template <typename ELFT>
Index: lld/trunk/ELF/SymbolTable.h
===================================================================
--- lld/trunk/ELF/SymbolTable.h
+++ lld/trunk/ELF/SymbolTable.h
@@ -45,9 +45,9 @@
Symbol *addUndefined(StringRef Name, uint8_t Binding, uint8_t StOther,
uint8_t Type, bool CanOmitFromDynSym, InputFile *File);
- Symbol *addDefined(StringRef Name, uint8_t StOther, uint8_t Type,
- uint64_t Value, uint64_t Size, uint8_t Binding,
- SectionBase *Section, InputFile *File);
+ Defined *addDefined(StringRef Name, uint8_t StOther, uint8_t Type,
+ uint64_t Value, uint64_t Size, uint8_t Binding,
+ SectionBase *Section, InputFile *File);
template <class ELFT>
void addShared(StringRef Name, SharedFile<ELFT> &F,
Index: lld/trunk/ELF/Writer.cpp
===================================================================
--- lld/trunk/ELF/Writer.cpp
+++ lld/trunk/ELF/Writer.cpp
@@ -172,15 +172,14 @@
Symbol *S = Symtab->find(Name);
if (!S || S->isDefined())
return nullptr;
- Symbol *Sym = Symtab->addDefined(Name, StOther, STT_NOTYPE, Val,
- /*Size=*/0, Binding, Sec,
- /*File=*/nullptr);
- return cast<Defined>(Sym);
+ return Symtab->addDefined(Name, StOther, STT_NOTYPE, Val,
+ /*Size=*/0, Binding, Sec,
+ /*File=*/nullptr);
}
static Defined *addAbsolute(StringRef Name) {
- return cast<Defined>(Symtab->addDefined(Name, STV_HIDDEN, STT_NOTYPE, 0, 0,
- STB_GLOBAL, nullptr, nullptr));
+ return Symtab->addDefined(Name, STV_HIDDEN, STT_NOTYPE, 0, 0, STB_GLOBAL,
+ nullptr, nullptr);
}
// The linker is expected to define some symbols depending on
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54627.175034.patch
Type: text/x-patch
Size: 2877 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181122/864ba769/attachment.bin>
More information about the llvm-commits
mailing list