[PATCH] D142314: [ORC] Add a NonOwningSymbolStringPtr utility.
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 22 21:36:23 PST 2023
dblaikie added inline comments.
================
Comment at: llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h:50-54
+#ifndef NDEBUG
+ // Useful for debugging and testing: This method can be used to identify
+ // non-owning pointers pointing to unowned pool entries.
+ size_t getRefCount(const SymbolStringPtrBase &S) const;
+#endif
----------------
Could this be private and friended to the test class, rather than only in +Asserts? (that way it'd be tested in non-Asserts, and not callable from code/accidentally used in +Asserts builds in the rest of the code)
================
Comment at: llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h:87-88
+
+ friend bool operator!=(const SymbolStringPtrBase &LHS,
+ const SymbolStringPtrBase &RHS) {
+ return !(LHS == RHS);
----------------
If these things are only `sizeof(void*)` then maybe pass by value, rather than const ref?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D142314/new/
https://reviews.llvm.org/D142314
More information about the llvm-commits
mailing list