mstorsjo wrote: > 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'.
Thanks! > 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. That sounds like a potential future improvement - but I'll skip trying to take on that at this point; your suggestions below were very doable! > 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. Thanks - with these pointers I was able to make it work! I also added tests for covering cases like having an implicit MSStructAttr from a pragma, plus an explicit one - making sure that this does produce an error if there's a GCCStructAttr on that one, etc. https://github.com/llvm/llvm-project/pull/71148 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
