Commits
Jordan Rose committed 1b1514673ad
[ClangImporter] A StructDecl should always have a RecordDecl as its Clang node. Specifically, it should not ever have a clang::TypedefDecl as its Clang node, even if the RecordDecl is anonymous and immediately wrapped in a typedef. It looks like no one was ever doing this intentionally; it's just left over from before we looked through typedefs at all. This is important because we use the clang::RecordDecl for IRGen layout if it's present; before this patch we would fall back to Swift layout for these structs (clearly wrong). The one exception here is enums -- NS_OPTIONS and named C enums get imported as structs as well. If we add any other exceptions, we should be sure they are dealt with in IRGen as well. The change in the printed interface output is due to the source location for the Clang node of an NS_ENUM or NS_OPTIONS decl being inside a macro. I didn't see a quick fix for this, so I'm going to ignore it for now. Swift SVN r21748