[cfe-commits] r154749 - in /cfe/trunk: lib/AST/Decl.cpp test/CodeGenCXX/visibility.cpp

Rafael Espíndola rafael.espindola at gmail.com
Mon Apr 16 12:32:01 PDT 2012


>> If at all possible I would like to propose the visibility changes to
>> 3.1. The particular case in PR12552 was extracted from a mozilla test
>> that failed with clang.
>
> This is really, really late.  That said, we definitely don't want to break mozilla.
> Is there a less aggressive fix?

I am not sure we broke it. Everything used to pass with an old clang
and a old firefox. This is very likely just a new test in firefox that
found the problem.

The issues is somewhat hard to fix in isolation. A reduced test is

struct HIDDEN RECT {
  int top;
};
DEFAULT RECT data_rect = {0};

The existing logic in merge lets the type visibility take precedence
over the one in the data_rect. What I think is the correct fix is what
I implemented in the patch I emailed: Change the merge logic to give
preference to what it already has and order the merge calls in
priority order, so that the attribute in data_rect wins.

What r154749 did was blindly put the check for attributes in the decl
last and use setVisibility to overwrite anything fond so far.

A vary hackish fix is to copy the new merge logic into a
mergeVisbility2 method and use it only in this case so that the rest
of the function doesn't need to be updated (attached).


> John.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 2250 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120416/07057b3f/attachment.obj>


More information about the cfe-commits mailing list