[PATCH] D104058: ThinLTO: Fix inline assembly references to static functions with CFI

Sami Tolvanen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 23 08:24:35 PDT 2021


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



More information about the cfe-commits mailing list