[PATCH] D96109: Refactor implementation of -funique-internal-linkage-names.

Sriraman Tallam via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 4 23:11:55 PST 2021


tmsriram created this revision.
tmsriram added reviewers: dblaikie, rnk, hoy, wmi.
Herald added subscribers: hiraditya, mgorny.
tmsriram requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The option -funique-internal-linkage-names was added in D73307 <https://reviews.llvm.org/D73307> and D8243 <https://reviews.llvm.org/D8243>  as a LLVM early pass to insert a unique suffix to internal linkage  functions and vars.  The unique suffix was the hash of the module path.  However, we found that this can be done more cleanly in clang early and the fixes that need to be done later can be completely avoided.  The fixes in particular are trying to modify the DW_AT_linkage_name and  finding the right place to insert the pass.

      

This patch ressurects the original implementation proposed in D73307 <https://reviews.llvm.org/D73307>  which was reviewed and then ditched in favor of the pass based approach.


https://reviews.llvm.org/D96109

Files:
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/CodeGen/CGCall.cpp
  clang/lib/CodeGen/CodeGenModule.cpp
  clang/lib/CodeGen/CodeGenModule.h
  clang/test/CodeGen/unique-internal-linkage-names.cpp
  llvm/include/llvm/InitializePasses.h
  llvm/include/llvm/Passes/PassBuilder.h
  llvm/include/llvm/Transforms/Utils.h
  llvm/include/llvm/Transforms/Utils/UniqueInternalLinkageNames.h
  llvm/lib/Passes/PassBuilder.cpp
  llvm/lib/Passes/PassRegistry.def
  llvm/lib/Transforms/Utils/CMakeLists.txt
  llvm/lib/Transforms/Utils/UniqueInternalLinkageNames.cpp
  llvm/lib/Transforms/Utils/Utils.cpp
  llvm/test/Transforms/UniqueInternalLinkageNames/unique-internal-linkage-names.ll
  llvm/test/Transforms/UniqueInternalLinkageNames/unique_symbol_names.ll
  llvm/tools/opt/NewPMDriver.cpp
  llvm/utils/gn/secondary/llvm/lib/Transforms/Utils/BUILD.gn

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96109.321663.patch
Type: text/x-patch
Size: 23029 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210205/f5d5b9bb/attachment.bin>


More information about the llvm-commits mailing list