[all-commits] [llvm/llvm-project] 847e40: [ASTWriter] Do not write ObjCCategories if empty. ...

David Green via All-commits all-commits at lists.llvm.org
Mon Jun 2 08:43:04 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 847e403ed7197988d4c8b95800b7e9b178d058a7
      https://github.com/llvm/llvm-project/commit/847e403ed7197988d4c8b95800b7e9b178d058a7
  Author: David Green <david.green at arm.com>
  Date:   2025-06-02 (Mon, 02 Jun 2025)

  Changed paths:
    M clang/lib/Serialization/ASTReaderDecl.cpp
    M clang/lib/Serialization/ASTWriter.cpp
    A clang/test/Modules/objc-categories.cpp

  Log Message:
  -----------
  [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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list