[PATCH] D121927: [Clang] Work with multiple pragmas weak before definition
Chris Bowler via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 18 12:43:38 PDT 2022
cebowleratibm accepted this revision.
cebowleratibm added a comment.
This revision is now accepted and ready to land.
Makes sense to me.
================
Comment at: clang/include/clang/Sema/Weak.h:35
inline SourceLocation getLocation() const { return loc; }
- void setUsed(bool Used=true) { used = Used; }
- inline bool getUsed() { return used; }
- bool operator==(WeakInfo RHS) const {
- return alias == RHS.getAlias() && loc == RHS.getLocation();
- }
- bool operator!=(WeakInfo RHS) const { return !(*this == RHS); }
+ void setUsed(bool Used = true) = delete;
+ inline bool getUsed() const = delete;
----------------
For my selfish education: what is the purpose of marking this deleted rather than actually deleting it?
================
Comment at: clang/test/CodeGen/pragma-weak.c:144
+///////////// PR28611: Try multiple aliases of same undeclared symbol or alias
+#pragma weak undecfunc_alias1 = undecfunc
+#pragma weak undecfunc_alias3 = undecfunc_alias2 // expected-warning {{alias will always resolve to undecfunc}}
----------------
small suggestion for test: repeat this line so that you cover the case where you're collecting identical WeakInfos to the same AliasName.
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