Commits
Ted Kremenek committed f43842e160e
Change processing of @asmname to use a new internal representation. This representation is inspired by Clang's internal representation. The current attribute representation, which is basically a union of "stuff" in DeclAttributes, is not amendable to richer attributes, such as @availability, that need to be implemented. In Clang, attributes are modeled with actual objects that encode both semantic and syntactic information (e.g., source ranges) that facilitate richer checking, better diagnostics, and better tools. This change is foundational for implementing @availability, but also is a better long-term representation. As a migratory path, it creates some duplications, with AttrKind and DeclAttrKind, the two which should eventually become the same thing. As part of this patch, there is some additional parser recovery (for the new attribute representation) for duplicate attributes. The parser now parses the entire duplicate attribute, which could be quite complex, and then issues a diagnostic that the attribute is a duplicate (and discarding it). This delayed diagnostic also allows us to present ranges for the duplicate attribute, which provides a better user experience. Swift SVN r15365