[all-commits] [llvm/llvm-project] 2c239d: Revert D135427 "[LTO] Make local linkage GlobalVal...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Nov 16 21:44:04 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2c239da6913dc7cb0710577c8e6b8e71cc1833c6
      https://github.com/llvm/llvm-project/commit/2c239da6913dc7cb0710577c8e6b8e71cc1833c6
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-11-16 (Wed, 16 Nov 2022)

  Changed paths:
    M llvm/lib/LTO/LTO.cpp
    M llvm/lib/Transforms/IPO/FunctionImport.cpp
    M llvm/test/LTO/Resolution/X86/comdat-mixed-lto.ll
    M llvm/test/ThinLTO/X86/Inputs/linkonce_resolution_comdat.ll
    R llvm/test/ThinLTO/X86/constructor-alias.ll
    M llvm/test/ThinLTO/X86/linkonce_resolution_comdat.ll
    R llvm/test/ThinLTO/X86/windows-vftable.ll

  Log Message:
  -----------
  Revert D135427 "[LTO] Make local linkage GlobalValue in non-prevailing COMDAT available_externally"

This reverts commit 8901635423cbea4324059a5127657126d2e00ce1.

This change broke the following example and we need to check `if (GO->getComdat()->getName() == GO->getName())`
before `NonPrevailingComdats.insert(GO->getComdat());`
Revert for clarify.

```
// a.cc
template <typename T>
struct A final { virtual ~A() {} };
extern "C" void aa() { A<int> a; }
// b.cc
template <typename T>
struct A final { virtual ~A() {} };
template struct A<int>;
extern "C" void bb(A<int> *a) { delete a; }

clang -c -fpic -O0 -flto=thin a.cc && ld.lld -shared a.o b.o
```




More information about the All-commits mailing list