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

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 22 18:09:58 PDT 2021


nickdesaulniers 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));
 
----------------
Can you avoid making a copy of the OldName by doing the `appendToCompilerUsed` BEFORE making the dangling reference via `ExportGV.setName(NewName);`?


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