llvm-project
847e403e - [ASTWriter] Do not write ObjCCategories if empty. (#141841)

Commit
119 days ago
[ASTWriter] Do not write ObjCCategories if empty. (#141841) This is a fix for a completely unrelated patch, that started to cause failures in the explicit-build.cpp test because the size of the b.pcm and b-not-a.pcm files became the same. The alignment added by empty ObjCCategory blobs being written to the file causes them to become the same size, and the error 'module file has a different size than expected' will not be emitted as the pcms only track module size, not content, for whether they are valid. This prevents that issue by not saving the ObjCCategories if it is empty. The change in clang/lib/Serialization/ASTReaderDecl.cpp is just formatting, but shows that the only use of ObjCCategoriesMap loaded from the file will be OK with null (never loaded) data. It is a bit of a weird fix, but should help decrease the size of the modules for objects that are not used.
Author
Parents
Loading