SuccessChanges

Summary

  1. [test] Make ELF tests immune to dso_local/dso_preemptable/(none) differences (details)
  2. Refactor how -fno-semantic-interposition sets dso_local on default visibility external linkage definitions (details)
Commit 219d00e0d90941d3e54fc711ea1e7b5e4b5b4335 by i
[test] Make ELF tests immune to dso_local/dso_preemptable/(none) differences

ELF -cc1 -mrelocation-model pic will default to no semantic interposition plus
setting dso_local on default visibility external linkage definitions, so that
COFF, Mach-O and ELF output will be similar.

This patch makes tests immune to the differences.
The file was modifiedclang/test/CodeGenCXX/default_calling_conv.cpp
The file was modifiedclang/test/CodeGenCUDA/lambda-reference-var.cu
The file was modifiedclang/test/OpenMP/nvptx_declare_target_var_ctor_dtor_codegen.cpp
The file was modifiedclang/test/Driver/hip-fpie-option.hip
Commit d1fd72343c6ff58a3b66bc0df56fed9ac21e4056 by i
Refactor how -fno-semantic-interposition sets dso_local on default visibility external linkage definitions

The idea is that the CC1 default for ELF should set dso_local on default
visibility external linkage definitions in the default -mrelocation-model pic
mode (-fpic/-fPIC) to match COFF/Mach-O and make output IR similar.

The refactoring is made available by 2820a2ca3a0e69c3f301845420e0067ffff2251b.

Currently only x86 supports local aliases. We move the decision to the driver.
There are three CC1 states:

* -fsemantic-interposition: make some linkages interposable and make default visibility external linkage definitions dso_preemptable.
* (default): selected if the target supports .Lfoo$local: make default visibility external linkage definitions dso_local
* -fhalf-no-semantic-interposition: if neither option is set or the target does not support .Lfoo$local: like -fno-semantic-interposition but local aliases are not used. So references can be interposed if not optimized out.

Add -fhalf-no-semantic-interposition to a few tests using the half-based semantic interposition behavior.
The file was modifiedclang/test/CodeGenCXX/RelativeVTablesABI/simple-vtable-definition.cpp
The file was modifiedclang/test/CodeGenCXX/RelativeVTablesABI/multiple-inheritance.cpp
The file was modifiedclang/test/CodeGenCXX/RelativeVTablesABI/override-pure-virtual-method.cpp
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedllvm/include/llvm/IR/Module.h
The file was modifiedclang/test/CodeGenCXX/RelativeVTablesABI/child-inheritted-from-parent-in-comdat.cpp
The file was modifiedclang/test/Driver/fsemantic-interposition.c
The file was modifiedllvm/lib/IR/Module.cpp
The file was modifiedclang/include/clang/Basic/LangOptions.def
The file was modifiedclang/test/CodeGenCXX/RelativeVTablesABI/inheritted-virtual-function.cpp
The file was modifiedclang/test/CodeGen/semantic-interposition.c
The file was modifiedllvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
The file was modifiedclang/test/CodeGenCXX/RelativeVTablesABI/diamond-inheritance.cpp
The file was modifiedclang/test/CodeGenCXX/RelativeVTablesABI/diamond-virtual-inheritance.cpp
The file was modifiedclang/lib/CodeGen/CodeGenModule.cpp
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
The file was removedclang/test/CodeGen/semantic-interposition-no.c
The file was modifiedclang/test/CodeGenCXX/RelativeVTablesABI/relative-vtables-flag.cpp
The file was modifiedclang/test/CodeGenCXX/RelativeVTablesABI/cross-translation-unit-2.cpp
The file was modifiedclang/test/CodeGenCXX/RelativeVTablesABI/inline-virtual-function.cpp
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedclang/test/CodeGenCXX/RelativeVTablesABI/overriden-virtual-function.cpp
The file was modifiedclang/test/CodeGen/attr-arm-sve-vector-bits-globals.c
The file was modifiedclang/test/CodeGenCXX/RelativeVTablesABI/no-alias-when-dso-local.cpp
The file was modifiedclang/test/CodeGenCXX/RelativeVTablesABI/cross-translation-unit-1.cpp