-
- Downloads
[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@ca.ibm.com> Co-authored-by:
Jamie Schmeiser <schmeise@ca.ibm.com>
Showing
- clang/docs/ReleaseNotes.rst 4 additions, 0 deletionsclang/docs/ReleaseNotes.rst
- clang/include/clang/Sema/Sema.h 15 additions, 5 deletionsclang/include/clang/Sema/Sema.h
- clang/include/clang/Sema/Weak.h 25 additions, 14 deletionsclang/include/clang/Sema/Weak.h
- clang/lib/Sema/Sema.cpp 10 additions, 8 deletionsclang/lib/Sema/Sema.cpp
- clang/lib/Sema/SemaDecl.cpp 2 additions, 5 deletionsclang/lib/Sema/SemaDecl.cpp
- clang/lib/Sema/SemaDeclAttr.cpp 20 additions, 20 deletionsclang/lib/Sema/SemaDeclAttr.cpp
- clang/lib/Serialization/ASTReader.cpp 4 additions, 7 deletionsclang/lib/Serialization/ASTReader.cpp
- clang/lib/Serialization/ASTWriter.cpp 8 additions, 7 deletionsclang/lib/Serialization/ASTWriter.cpp
- clang/test/CodeGen/pragma-weak.c 13 additions, 0 deletionsclang/test/CodeGen/pragma-weak.c
- clang/test/PCH/pragma-weak-functional.c 17 additions, 0 deletionsclang/test/PCH/pragma-weak-functional.c
- clang/test/PCH/pragma-weak-functional.h 6 additions, 0 deletionsclang/test/PCH/pragma-weak-functional.h
Loading
Please register or sign in to comment