[PATCH] D35793: [ELF] - Change way how we handle --noinhibit-exec

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 15:44:19 PDT 2017


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

> +static void errorOrWarn(const Twine &Msg) {
> +  if (!Config->NoinhibitExec)
> +    error(Msg);
> +  else
> +    warn(Msg);
> +}
> +
>  template <class ELFT>
>  static RelExpr adjustExpr(SymbolBody &Body, RelExpr Expr, uint32_t Type,
>                            const uint8_t *Data, InputSectionBase &S,
> @@ -691,7 +698,7 @@
>      Msg += Src + "\n>>>               ";
>    Msg += S.getObjMsg<ELFT>(Offset);
>  
> -  if (Config->UnresolvedSymbols == UnresolvedPolicy::WarnAll ||
> +  if (Config->NoinhibitExec ||
>        (Config->UnresolvedSymbols == UnresolvedPolicy::Warn && CanBeExternal)) {
>      warn(Msg);
>    } else {

Instead of checking NoinhibitExec you can replace the error in the else
with errorOrWarn, no?

That way there are two uses of errorOrWarn and we check NoinhibitExec in
one place.

Cheers,
Rafael


More information about the llvm-commits mailing list