samitolvanen added inline comments.

================
Comment at: llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:58-80
+    std::string OldName = Name.str();
     std::string NewName = (Name + ModuleId).str();
 
     if (const auto *C = ExportGV.getComdat())
       if (C->getName() == Name)
         RenamedComdats.try_emplace(C, ExportM.getOrInsertComdat(NewName));
 
----------------
nickdesaulniers wrote:
> Can you avoid making a copy of the OldName by doing the 
> `appendToCompilerUsed` BEFORE making the dangling reference via 
> `ExportGV.setName(NewName);`?
No, I have to rename the existing function before I can create an alias with 
the same name, and as `ExportGV.setName()` invalidates `Name`, I need to create 
a copy first.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104058

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to