Description
If the attribute is only used in doing semantic checks for applying other attributes and when lowering to LLVM IR, then I think the swap should happen when lowering to LLVM IR and not when creating the semantic attribute.
If the attribute is used in other parts of the compiler (static analysis checks, clang-tidy checks, other parts of Sema than SemaDeclAttr.cpp), then I think it's worth discussing whether the semantic attribute should have the swapped values (so that users of the semantic attribute don't have to think about whether they need the swap or not). In this case, we should probably pick more descriptive names than X, Y, and Z for the semantic attribute arguments (and we'd have to add some code in to the various AST places to unswap).
Originally posted by @AaronBallman in #2906 (comment)