================
@@ -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>>
----------------
pdschbrt wrote:

I agree. If it was a hot path, I would have opted for a larger git diff and 
spent more energy on improving the situation.

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