jansvoboda11 added a comment.

In D95629#2528931 <https://reviews.llvm.org/D95629#2528931>, @dexonsmith wrote:

> I think this patch can be skipped. `StringMap` owns its own strings. 
> `StringMapEntry` uses tail allocation to include a null-terminated string 
> inline. For details, have a look at `StringMapEntry::Create` in 
> llvm/ADT/StringMapEntry.h.

You're right.

I first discovered lifetime issues with `Config` when using a non-stable data 
structure for holding allocated strings. Reading the documentation and looking 
at the API of `StringMap` made me believe the keys are not owned and I forgot 
to double-check.

Closing this, as D95369 <https://reviews.llvm.org/D95369> works correctly 
regardless.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95629/new/

https://reviews.llvm.org/D95629

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D95629: [c... Jan Svoboda via Phabricator via cfe-commits
    • [PATCH] D9562... Duncan P. N. Exon Smith via Phabricator via cfe-commits
    • [PATCH] D9562... Jan Svoboda via Phabricator via cfe-commits

Reply via email to