[llvm] [IR] Fix string overlap issue in `Value::setNameImpl` (PR #158288)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 16 01:28:08 PDT 2025


================
@@ -356,6 +356,16 @@ void Value::setNameImpl(const Twine &NewName) {
   if (getSymTab(this, ST))
     return;  // Cannot set a name on this value (e.g. constant).
 
+  // Copy NewName forcely if the memory overlaps.
----------------
nikic wrote:

```suggestion
  // Copy NewName if the memory overlaps.
```
or "forcefully", but I think you can just omit it.

https://github.com/llvm/llvm-project/pull/158288


More information about the llvm-commits mailing list