[all-commits] [llvm/llvm-project] ce21c9: [Clang] Work with multiple pragmas weak before def...

Hubert Tong via All-commits all-commits at lists.llvm.org
Thu Mar 24 17:20:17 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ce21c926f8efe969717e21e3ae6c5a3246b3d455
      https://github.com/llvm/llvm-project/commit/ce21c926f8efe969717e21e3ae6c5a3246b3d455
  Author: Hubert Tong <hubert.reinterpretcast at gmail.com>
  Date:   2022-03-24 (Thu, 24 Mar 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Sema/Sema.h
    M clang/include/clang/Sema/Weak.h
    M clang/lib/Sema/Sema.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclAttr.cpp
    M clang/lib/Serialization/ASTReader.cpp
    M clang/lib/Serialization/ASTWriter.cpp
    M clang/test/CodeGen/pragma-weak.c
    A clang/test/PCH/pragma-weak-functional.c
    A clang/test/PCH/pragma-weak-functional.h

  Log Message:
  -----------
  [Clang] Work with multiple pragmas weak before definition

Update `WeakUndeclaredIdentifiers` to hold a collection of weak
aliases per identifier instead of only one.

This also allows the "used" state to be removed from `WeakInfo`
because it is really only there as an alternative to removing
processed map entries, and we can represent that using an empty set
now. The serialization code is updated for the removal of the field.
Additionally, a PCH test is added for the new functionality.

The records are grouped by the "target" identifier, which was already
being used as a key for lookup purposes. We also store only one record
per alias name; combined, this means that diagnostics are grouped by
the "target" and limited to one per alias (which should be acceptable).

Fixes PR28611.
Fixes llvm/llvm-project#28985.

Reviewed By: aaron.ballman, cebowleratibm

Differential Revision: https://reviews.llvm.org/D121927

Co-authored-by: Rachel Craik <rcraik at ca.ibm.com>
Co-authored-by: Jamie Schmeiser <schmeise at ca.ibm.com>




More information about the All-commits mailing list