================
@@ -506,7 +506,10 @@ class CodeGenModule : public CodeGenTypeCache {
 
   // Store deferred function annotations so they can be emitted at the end with
   // most up to date ValueDecl that will have all the inherited annotations.
-  llvm::MapVector<StringRef, const ValueDecl *> DeferredAnnotations;
+  // The key owns its storage: not every mangled name handed to
+  // GetOrCreateLLVMFunction outlives the call.
+  llvm::MapVector<std::string, const ValueDecl *, llvm::StringMap<unsigned>>
----------------
efriedma-quic wrote:

It's a pretty terrible datastructure from a theoretical standpoint: it stores 
two copies of every string, and makes an additional copy every time you perform 
a lookup.  But it looks like this isn't the first place we're doing this, and 
this code isn't performance-sensitive, so I guess it's fine.

https://github.com/llvm/llvm-project/pull/226942
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to