[PATCH] D67945: LowerTypeTests: Rename local functions to avoid collisions with identically named functions in ThinLTO modules.

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 18:15:49 PDT 2019


dexonsmith added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/LowerTypeTests.cpp:1890-1896
+        if (F && F->hasLocalLinkage()) {
+          // Locally defined function that happens to have the same name as a
+          // function defined in a ThinLTO module. Rename it to move it out of
+          // the way of the external reference that we're about to create.
+          F->setName(F->getName() + ".1");
+          F = nullptr;
+        }
----------------
This looks like it could collide with an existing function.  Clang handles this in a few places by looping until it finds an available name.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67945





More information about the llvm-commits mailing list