[lld] r315425 - Remove a static local varaible.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 20 12:40:30 PDT 2017


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

> -static void sortBySymbolOrder(MutableArrayRef<InputSection *> Vec) {
> -  if (Config->SymbolOrderingFile.empty())
> -    return;
> -  static llvm::DenseMap<SectionBase *, int> Order = buildSectionOrder();
> -  sortByOrder(Vec, [&](InputSectionBase *S) { return Order.lookup(S); });
> -}
> -
>  // Compute and remember which sections the InputSectionDescription matches.
>  std::vector<InputSection *>
>  LinkerScript::computeInputSections(const InputSectionDescription *Cmd) {
>    std::vector<InputSection *> Ret;
> +  DenseMap<SectionBase *, int> Order = buildSectionOrder();

This now computes buildSectionOrder unconditionally. buildSectionOrder
is non trivial.

Cheers,
Rafael


More information about the llvm-commits mailing list