[PATCH] D121927: [Clang] Work with multiple pragmas weak before definition

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 23 11:11:44 PDT 2022


hubert.reinterpretcast added inline comments.


================
Comment at: clang/include/clang/Sema/Weak.h:47
+    static unsigned getHashValue(const WeakInfo &W) {
+      return W.getAlias() ? DenseMapInfo::getHashValue(W.getAlias()->getName())
+                          : DenseMapInfo::getHashValue("");
----------------
The fact that `WeakUndeclaredIdentifiers` is keyed by `IdentifierInfo *` must mean that it is safe to use pointer comparison. This is further bolstered by `IdentifierInfo` having only private or deleted constructors (with `IdentifierTable` being a friend class).

I will adjust to make this class simply forward to `DenseMapInfo<const IdentifierInfo *>` with the alias members.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121927/new/

https://reviews.llvm.org/D121927



More information about the cfe-commits mailing list