Skip to content

Commit cb26a2b

Browse files
committed
fix(metadata-generator): keep categories of retained classes when filtering
A category cursor is spelled with the category's own name, so a whitelist naming only the class dropped every member declared in its categories. On iOS that removed UIViewGeometry, leaving UIView.frame read-only. Categories only attach to classes that are retained, so they no longer go through the symbol filter.
1 parent c68bbef commit cb26a2b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎metadata-generator/src/IR/Factory.cpp‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ bool MetadataFactory::shouldProcess(CXCursor cursor, bool required) {
113113
return shouldInclude;
114114
}
115115

116+
// A category is named for itself, not the class it extends. Its members
117+
// only attach to classes that are kept, so it is never filtered by name.
118+
if (clang_getCursorKind(cursor) == CXCursor_ObjCCategoryDecl) {
119+
return true;
120+
}
121+
116122
CXString cxSymbol = clang_getCursorSpelling(cursor);
117123
const char* symbolCString = clang_getCString(cxSymbol);
118124
std::string symbol = symbolCString ? symbolCString : "";

0 commit comments

Comments
 (0)