Martin =?utf-8?q?Storsjö?= <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>


erichkeane wrote:

> > Oof. I didn't realize we had that as a pragma. :-/ Yeah, I think the 
> > expected priority is: local takes precedence over pragma takes precedence 
> > over command line. So you may have to do the exclusion the hard way 
> > (manually).
> 
> Thanks! Yes, such an order of precedence seems reasonable.
> 
> As the pragma seems to show up in the form of an attribute at the level of 
> `AST/Decl.cpp`, at what level should I check this to be able to distinguish 
> pragma+attribute vs attribute+attribute?

I haven't spent any time with that pragma, but best I can tell is that the 
pragma creates it (SemaAttr.cpp ~92) as 'implicit'.  

I DO wonder if we should have some sort of fix to the `MutualExclusion` logic 
as table-gen'ed to allow `explicit > implicit`.  There is some additional work 
then to make sure that the explicit wins in codegen in this case (OR, we have 
it remove the implict/skip the implicit add at that point?) so that only 1 
shows up in the AST.

Otherwise, you'd need a custom `handleXXXAttr` (remove the `hasSimpleHandler` 
from Attr.td, then add handlers to SemaDeclAttr.cpp) that do the checks.

Obviously the 'implicit' one is added in a different step, so that probably 
should check to make sure it isn't adding if the GCC one already is though.

https://github.com/llvm/llvm-project/pull/71148
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to