DavidSpickett added inline comments.
================ Comment at: lldb/include/lldb/Target/MemoryTagMap.h:29 + /// Non-null pointer to a memory tag manager. + MemoryTagMap(const MemoryTagManager *manager); + ---------------- DavidSpickett wrote: > JDevlieghere wrote: > > If the pointer should be non-null, then should this take a reference > > instead? > I would like to do that but in a later patch I have: > ``` > static llvm::Optional<MemoryTagMap> > GetMemoryTags(lldb::addr_t addr, size_t length, > ExecutionContextScope *exe_scope) { > ``` > Can't have references in an optional. > > However looking again, I think I could check `.empty()` instead of using an > Optional. I'll try that. So the reason this doesn't work: * Later we have a function that wants to return a memorytagmap. * The current arch may not have tagging at all, so it wouldn't have any tag manager to reference. * Hence Optional<MemoryTagManager> makes sense for the return type. * Optionals cannot include references, so pointer is the best we can do. On the plus side, this class only has a single user for now so ensuring the non-null part isn't difficult. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112825/new/ https://reviews.llvm.org/D112825 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits