[lld] r344294 - Rename SymbolTable::addRegular -> SymbolTable::addDefined.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 11 13:43:01 PDT 2018
Author: ruiu
Date: Thu Oct 11 13:43:01 2018
New Revision: 344294
URL: http://llvm.org/viewvc/llvm-project?rev=344294&view=rev
Log:
Rename SymbolTable::addRegular -> SymbolTable::addDefined.
We have addAbsolute, addBitcode, addCommon, etc. addRegular looked a
bit inconsistent.
Modified:
lld/trunk/ELF/InputFiles.cpp
lld/trunk/ELF/SymbolTable.cpp
lld/trunk/ELF/SymbolTable.h
lld/trunk/ELF/Writer.cpp
Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=344294&r1=344293&r2=344294&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Thu Oct 11 13:43:01 2018
@@ -813,7 +813,7 @@ template <class ELFT> Symbol *ObjFile<EL
if (Sec == &InputSection::Discarded)
return Symtab->addUndefined<ELFT>(Name, Binding, StOther, Type,
/*CanOmitFromDynSym=*/false, this);
- return Symtab->addRegular(Name, StOther, Type, Value, Size, Binding, Sec,
+ return Symtab->addDefined(Name, StOther, Type, Value, Size, Binding, Sec,
this);
}
}
@@ -1202,11 +1202,11 @@ void BinaryFile::parse() {
if (!isAlnum(S[I]))
S[I] = '_';
- Symtab->addRegular(Saver.save(S + "_start"), STV_DEFAULT, STT_OBJECT, 0, 0,
+ Symtab->addDefined(Saver.save(S + "_start"), STV_DEFAULT, STT_OBJECT, 0, 0,
STB_GLOBAL, Section, nullptr);
- Symtab->addRegular(Saver.save(S + "_end"), STV_DEFAULT, STT_OBJECT,
+ Symtab->addDefined(Saver.save(S + "_end"), STV_DEFAULT, STT_OBJECT,
Data.size(), 0, STB_GLOBAL, Section, nullptr);
- Symtab->addRegular(Saver.save(S + "_size"), STV_DEFAULT, STT_OBJECT,
+ Symtab->addDefined(Saver.save(S + "_size"), STV_DEFAULT, STT_OBJECT,
Data.size(), 0, STB_GLOBAL, nullptr, nullptr);
}
Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=344294&r1=344293&r2=344294&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Thu Oct 11 13:43:01 2018
@@ -142,7 +142,7 @@ template <class ELFT> void SymbolTable::
Defined *SymbolTable::addAbsolute(StringRef Name, uint8_t Visibility,
uint8_t Binding) {
Symbol *Sym =
- addRegular(Name, Visibility, STT_NOTYPE, 0, 0, Binding, nullptr, nullptr);
+ addDefined(Name, Visibility, STT_NOTYPE, 0, 0, Binding, nullptr, nullptr);
return cast<Defined>(Sym);
}
@@ -471,7 +471,7 @@ static void reportDuplicate(Symbol *Sym,
error(Msg);
}
-Symbol *SymbolTable::addRegular(StringRef Name, uint8_t StOther, uint8_t Type,
+Symbol *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;
Modified: lld/trunk/ELF/SymbolTable.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.h?rev=344294&r1=344293&r2=344294&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.h (original)
+++ lld/trunk/ELF/SymbolTable.h Thu Oct 11 13:43:01 2018
@@ -47,7 +47,7 @@ public:
Symbol *addUndefined(StringRef Name, uint8_t Binding, uint8_t StOther,
uint8_t Type, bool CanOmitFromDynSym, InputFile *File);
- Symbol *addRegular(StringRef Name, uint8_t StOther, uint8_t Type,
+ Symbol *addDefined(StringRef Name, uint8_t StOther, uint8_t Type,
uint64_t Value, uint64_t Size, uint8_t Binding,
SectionBase *Section, InputFile *File);
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=344294&r1=344293&r2=344294&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Thu Oct 11 13:43:01 2018
@@ -170,7 +170,7 @@ static Defined *addOptionalRegular(Strin
Symbol *S = Symtab->find(Name);
if (!S || S->isDefined())
return nullptr;
- Symbol *Sym = Symtab->addRegular(Name, StOther, STT_NOTYPE, Val,
+ Symbol *Sym = Symtab->addDefined(Name, StOther, STT_NOTYPE, Val,
/*Size=*/0, Binding, Sec,
/*File=*/nullptr);
return cast<Defined>(Sym);
@@ -1550,7 +1550,7 @@ template <class ELFT> void Writer<ELFT>:
// Even the author of gold doesn't remember why gold behaves that way.
// https://sourceware.org/ml/binutils/2002-03/msg00360.html
if (In.DynSymTab)
- Symtab->addRegular("_DYNAMIC", STV_HIDDEN, STT_NOTYPE, 0 /*Value*/,
+ Symtab->addDefined("_DYNAMIC", STV_HIDDEN, STT_NOTYPE, 0 /*Value*/,
/*Size=*/0, STB_WEAK, In.Dynamic,
/*File=*/nullptr);
More information about the llvm-commits
mailing list