[cfe-dev] Should dump methods be LLVM_ATTRIBUTE_USED only in debug builds?

Alp Toker alp at nuanti.com
Fri Jan 3 13:08:04 PST 2014


On 03/01/2014 19:41, Chandler Carruth wrote:
> On Fri, Jan 3, 2014 at 2:03 PM, Nico Weber <thakis at chromium.org 
> <mailto:thakis at chromium.org>> wrote:
>
>     On Fri, Jan 3, 2014 at 10:15 AM, Nico Weber <thakis at chromium.org
>     <mailto:thakis at chromium.org>> wrote:
>
>         Ok, sounds like it's not clear if folks want to have dump
>         methods behind #ifdef !NDEBUG. Maybe we don't have to resolve
>         that part in this thread
>
>         Is there any opposition to replacing the attributes on just
>         the dump methods with LLVM_DUMP_METHOD? That's a subset of
>         Chandler's change and I think also what Alp's diff is.
>
>     …which is effectively Alp's patch I suppose. So maybe we could
>     land that for now and then discuss whether to put dump() methods
>     in !NDEBUG at some other point?
>
>
> I'd like to actually see the patch rather than talk in the hypothetical.

The patch was in the original mail you replied to.

> Maybe I misunderstood, but I thought it also moved the attribute to 
> the definition? I don't understand why that's relevant yet (which is 
> why maybe I've misunderstood what was happening).

Explained in the original mail.

> I've asked what the bug was that this addressed.

Listed in the original mail, complete with references and explanations.

> My reading of the spec for the attribute seems to indicate that there 
> is no difference....
>

If there's no spec difference between the declaration and definition 
forms, that's a good reason to avoid the form that's problematic and go 
with the simple patch in the original mail.

I'm not going to make arbitrary changes to code that's done the way it 
is for a good reason.

Alp.


-- 
http://www.nuanti.com
the browser experts




More information about the cfe-dev mailing list