[PATCH] D35987: [ELF] - Introduce std::vector<InputFile *> global arrays.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 17:15:39 PDT 2017


George Rimar via Phabricator <reviews at reviews.llvm.org> writes:

> ===================================================================
> --- ELF/SyntheticSections.cpp
> +++ ELF/SyntheticSections.cpp
> @@ -1027,9 +1027,10 @@
>    if (!Config->Rpath.empty())
>      add({Config->EnableNewDtags ? DT_RUNPATH : DT_RPATH,
>           InX::DynStrTab->addString(Config->Rpath)});
> -  for (SharedFile<ELFT> *F : SharedFile<ELFT>::Instances)
> -    if (F->isNeeded())
> -      add({DT_NEEDED, InX::DynStrTab->addString(F->SoName)});
> +  for (InputFile *File : SharedFiles)
> +    if (SharedFile<ELFT> *F = cast<SharedFile<ELFT>>(File))

You don't need an 'if' if you are using a cast.

This seems reasonable. I will take a look at the dependencies to have a
better idea.

Cheers,
Rafael


More information about the llvm-commits mailing list