[PATCH] Select new undefined atom rather than old one if other conditions are the same.

Nick Kledzik kledzik at apple.com
Thu Nov 14 19:06:24 PST 2013


On Nov 14, 2013, at 6:57 PM, Rui Ueyama <ruiu at google.com> wrote:

> On Thu, Nov 14, 2013 at 6:41 PM, kledzik at apple.com <kledzik at apple.com> wrote:
> 
> 
> ================
> Comment at: lib/Core/SymbolTable.cpp:192-194
> @@ +191,5 @@
> +    const UndefinedAtom *newFallback = newUndef->fallback();
> +    bool hasDifferentFallback =
> +        (existingFallback && newFallback &&
> +         existingFallback->name() != newFallback->name());
> +    if (hasDifferentFallback) {
> ----------------
> hasDifferentFallback should also be true if one has a fallback and the other does not.
> 
> If the existing atom does not have a fallback and new one has, it's normal -- no need to warn that. So the condition would be a bit complicated that.
Ah!  If one has a fallback and the other does not, you always silently choose the one with a fallback.  The only time you need a warning is when both define fallbacks but they are different.

LGTM.

-Nick


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131114/27c55435/attachment.html>


More information about the llvm-commits mailing list