Commits

Doug Gregor committed d690ca4ae30
[Clang importer] Clean up creation and conflict checking of CF "Ref" type aliases. CF types are generally imported twice, once with the "Ref" and once without the "Ref", unless the non-"Ref" version would conflict with some other declaration (e.g., an Objective-C class of the same name). The logic to create both versions was a bit convoluted, and tended to return the "Ref" version as the primary declaration, which conflicts with our general inclination to use the non-"Ref" version. Now we create the non-"Ref" version directly and then create the aliased "Ref" version as an alternate declaration. The "Ref" version is a typealias of the non-"Ref" version, and the "Ref" version is never used anywhere else in the AST. Also, improve the conflict resolution for cases where the only conflicting declaration is an opaque tag used to declare the CF type itself, e.g., typedef struct CGImage *CGImageRef; These cases used to be considered conflicts, but they are benign because the underlying struct will never actually be imported. Make them not conflicts, so we get the preferred name "CGImage" rather than "CGImageRef".