[lld] r316809 - Rename isInCurrentDSO -> isInCurrentOutput.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 3 12:18:49 PDT 2017


That is a much better name.

Thanks,
Rafael

Rui Ueyama via llvm-commits <llvm-commits at lists.llvm.org> writes:

> Author: ruiu
> Date: Fri Oct 27 15:54:16 2017
> New Revision: 316809
>
> URL: http://llvm.org/viewvc/llvm-project?rev=316809&view=rev
> Log:
> Rename isInCurrentDSO -> isInCurrentOutput.
>
> DSO is short for dynamic shared object, so the function name was a
> little confusing because it sounded like it didn't work when we were
> a creating statically-linked executable or something.
>
> What we mean by "DSO" here is the current output file that we are
> creating. Thus the new name. Alternatively, we could call it the current
> ELF module, but "module" is a overloaded word, so I avoided that.
>
> Modified:
>     lld/trunk/ELF/MarkLive.cpp
>     lld/trunk/ELF/SymbolTable.cpp
>     lld/trunk/ELF/Symbols.cpp
>     lld/trunk/ELF/Symbols.h
>     lld/trunk/ELF/SyntheticSections.cpp
>     lld/trunk/ELF/Writer.cpp
>
> Modified: lld/trunk/ELF/MarkLive.cpp
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/MarkLive.cpp?rev=316809&r1=316808&r2=316809&view=diff
> ==============================================================================
> --- lld/trunk/ELF/MarkLive.cpp (original)
> +++ lld/trunk/ELF/MarkLive.cpp Fri Oct 27 15:54:16 2017
> @@ -74,7 +74,7 @@ static void resolveReloc(InputSectionBas
>      return;
>    }
>  
> -  if (!B.isInCurrentDSO())
> +  if (!B.isInCurrentOutput())
>      for (InputSectionBase *Sec : CNamedSections.lookup(B.getName()))
>        Fn(Sec, 0);
>  }
>
> Modified: lld/trunk/ELF/SymbolTable.cpp
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=316809&r1=316808&r2=316809&view=diff
> ==============================================================================
> --- lld/trunk/ELF/SymbolTable.cpp (original)
> +++ lld/trunk/ELF/SymbolTable.cpp Fri Oct 27 15:54:16 2017
> @@ -210,7 +210,7 @@ void SymbolTable::applySymbolRenames() {
>  
>      Symbol *Real = &Origs[I];
>      // If __real_foo was undefined, we don't want it in the symbol table.
> -    if (!Real->body()->isInCurrentDSO())
> +    if (!Real->body()->isInCurrentOutput())
>        continue;
>  
>      auto *NewSym = make<Symbol>();
> @@ -324,7 +324,7 @@ Symbol *SymbolTable::addUndefined(String
>    }
>    if (Binding != STB_WEAK) {
>      SymbolBody *B = S->body();
> -    if (!B->isInCurrentDSO())
> +    if (!B->isInCurrentOutput())
>        S->Binding = Binding;
>      if (auto *SS = dyn_cast<SharedSymbol>(B))
>        SS->getFile<ELFT>()->IsUsed = true;
> @@ -364,7 +364,7 @@ static int compareDefined(Symbol *S, boo
>    if (WasInserted)
>      return 1;
>    SymbolBody *Body = S->body();
> -  if (!Body->isInCurrentDSO())
> +  if (!Body->isInCurrentOutput())
>      return 1;
>  
>    if (int R = compareVersion(S, Name))
> @@ -659,7 +659,7 @@ StringMap<std::vector<SymbolBody *>> &Sy
>      DemangledSyms.emplace();
>      for (Symbol *Sym : SymVector) {
>        SymbolBody *B = Sym->body();
> -      if (!B->isInCurrentDSO())
> +      if (!B->isInCurrentOutput())
>          continue;
>        if (Optional<std::string> S = demangle(B->getName()))
>          (*DemangledSyms)[*S].push_back(B);
> @@ -674,7 +674,7 @@ std::vector<SymbolBody *> SymbolTable::f
>    if (Ver.IsExternCpp)
>      return getDemangledSyms().lookup(Ver.Name);
>    if (SymbolBody *B = find(Ver.Name))
> -    if (B->isInCurrentDSO())
> +    if (B->isInCurrentOutput())
>        return {B};
>    return {};
>  }
> @@ -692,7 +692,7 @@ std::vector<SymbolBody *> SymbolTable::f
>  
>    for (Symbol *Sym : SymVector) {
>      SymbolBody *B = Sym->body();
> -    if (B->isInCurrentDSO() && M.match(B->getName()))
> +    if (B->isInCurrentOutput() && M.match(B->getName()))
>        Res.push_back(B);
>    }
>    return Res;
>
> Modified: lld/trunk/ELF/Symbols.cpp
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=316809&r1=316808&r2=316809&view=diff
> ==============================================================================
> --- lld/trunk/ELF/Symbols.cpp (original)
> +++ lld/trunk/ELF/Symbols.cpp Fri Oct 27 15:54:16 2017
> @@ -228,7 +228,7 @@ void SymbolBody::parseSymbolVersion() {
>    Name = {S.data(), Pos};
>  
>    // If this is not in this DSO, it is not a definition.
> -  if (!isInCurrentDSO())
> +  if (!isInCurrentOutput())
>      return;
>  
>    // '@@' in a symbol name means the default version.
> @@ -330,7 +330,7 @@ uint8_t Symbol::computeBinding() const {
>      return Binding;
>    if (Visibility != STV_DEFAULT && Visibility != STV_PROTECTED)
>      return STB_LOCAL;
> -  if (VersionId == VER_NDX_LOCAL && body()->isInCurrentDSO())
> +  if (VersionId == VER_NDX_LOCAL && body()->isInCurrentOutput())
>      return STB_LOCAL;
>    if (Config->NoGnuUnique && Binding == STB_GNU_UNIQUE)
>      return STB_GLOBAL;
> @@ -342,7 +342,7 @@ bool Symbol::includeInDynsym() const {
>      return false;
>    if (computeBinding() == STB_LOCAL)
>      return false;
> -  if (!body()->isInCurrentDSO())
> +  if (!body()->isInCurrentOutput())
>      return true;
>    return ExportDynamic;
>  }
>
> Modified: lld/trunk/ELF/Symbols.h
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=316809&r1=316808&r2=316809&view=diff
> ==============================================================================
> --- lld/trunk/ELF/Symbols.h (original)
> +++ lld/trunk/ELF/Symbols.h Fri Oct 27 15:54:16 2017
> @@ -69,7 +69,7 @@ public:
>      return SymbolKind == LazyArchiveKind || SymbolKind == LazyObjectKind;
>    }
>  
> -  bool isInCurrentDSO() const {
> +  bool isInCurrentOutput() const {
>      return SymbolKind == DefinedRegularKind || SymbolKind == DefinedCommonKind;
>    }
>  
>
> Modified: lld/trunk/ELF/SyntheticSections.cpp
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=316809&r1=316808&r2=316809&view=diff
> ==============================================================================
> --- lld/trunk/ELF/SyntheticSections.cpp (original)
> +++ lld/trunk/ELF/SyntheticSections.cpp Fri Oct 27 15:54:16 2017
> @@ -1124,10 +1124,10 @@ template <class ELFT> void DynamicSectio
>    }
>  
>    if (SymbolBody *B = Symtab->find(Config->Init))
> -    if (B->isInCurrentDSO())
> +    if (B->isInCurrentOutput())
>        add({DT_INIT, B});
>    if (SymbolBody *B = Symtab->find(Config->Fini))
> -    if (B->isInCurrentDSO())
> +    if (B->isInCurrentOutput())
>        add({DT_FINI, B});
>  
>    bool HasVerNeed = In<ELFT>::VerNeed->getNeedNum() != 0;
> @@ -1794,7 +1794,7 @@ void GnuHashTableSection::addSymbols(std
>          // linker has to look them up, so they have to be in the hash table.
>          if (auto *SS = dyn_cast<SharedSymbol>(S.Symbol))
>            return SS->CopyRelSec == nullptr && !SS->NeedsPltAddr;
> -        return !S.Symbol->isInCurrentDSO();
> +        return !S.Symbol->isInCurrentOutput();
>        });
>    if (Mid == V.end())
>      return;
>
> Modified: lld/trunk/ELF/Writer.cpp
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=316809&r1=316808&r2=316809&view=diff
> ==============================================================================
> --- lld/trunk/ELF/Writer.cpp (original)
> +++ lld/trunk/ELF/Writer.cpp Fri Oct 27 15:54:16 2017
> @@ -749,7 +749,7 @@ static DefinedRegular *
>  addOptionalRegular(StringRef Name, SectionBase *Sec, uint64_t Val,
>                     uint8_t StOther = STV_HIDDEN, uint8_t Binding = STB_GLOBAL) {
>    SymbolBody *S = Symtab->find(Name);
> -  if (!S || S->isInCurrentDSO())
> +  if (!S || S->isInCurrentOutput())
>      return nullptr;
>    Symbol *Sym = Symtab->addRegular<ELFT>(Name, StOther, STT_NOTYPE, Val,
>                                           /*Size=*/0, Binding, Sec,
> @@ -1223,7 +1223,7 @@ static bool computeIsPreemptible(const S
>  
>    // At this point copy relocations have not been created yet, so any
>    // symbol that is not defined locally is preemptible.
> -  if (!B.isInCurrentDSO())
> +  if (!B.isInCurrentOutput())
>      return true;
>  
>    // If we have a dynamic list it specifies which local symbols are preemptible.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list