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

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 22 13:10:41 PDT 2022


hubert.reinterpretcast marked an inline comment as done.
hubert.reinterpretcast added inline comments.


================
Comment at: clang/include/clang/Sema/Weak.h:33
+      : alias(Alias), loc(Loc) {}
+  inline IdentifierInfo *getAlias() const { return alias; }
   inline SourceLocation getLocation() const { return loc; }
----------------
aaron.ballman wrote:
> Would it be onerous to make the return type be `const IdentifierInfo *` given that the function is `const`? (If it is, just ignore the suggestion -- I love adding const correctness where we can get it basically for free.)
It's not free but I can post an NFC patch to add the `const` through. On the chain of calls that `const` needs to be added to, the pointer eventually feeds a `DeclarationName` (which already takes `const IdentifierInfo *`).


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