aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2024-04-15 17:58:39 -0700
committerGitHub <noreply@github.com>2024-04-15 17:58:39 -0700
commit2ac562ab784c6bf04e6d3026c567d3552a735668 (patch)
treec51cc1b6e588bc5c7f673f00c0f2ca31386e2c99 /clang/lib/CodeGen/CodeGenModule.cpp
parent694c444b5bbb56dcba8978d283fe5385237c309a (diff)
downloadllvm-2ac562ab784c6bf04e6d3026c567d3552a735668.zip
llvm-2ac562ab784c6bf04e6d3026c567d3552a735668.tar.gz
llvm-2ac562ab784c6bf04e6d3026c567d3552a735668.tar.bz2
[Sema] Mark alias/ifunc targets used and consider mangled names
https://reviews.llvm.org/D54188 marked "alias" targets as used in C to fix -Wunused false positives. This patch extends the approach to handle mangled names to support global scope names in C++ and the `overloadable` attribute in C. In addition, we mark ifunc targets as used to fix #63957. While our approach has false negatives for namespace scope names, the majority of alias/ifunc C++ uses (global scope with no overloads) are handled. Note: The following function with internal linkage but C language linkage type is mangled in Clang but not in GCC. This inconsistency makes alias/ifunc difficult to use in C++ with portability (#88593). ``` extern "C" { static void f0() {} // GCC: void g0() __attribute__((alias("_ZL2f0v"))); // Clang: void g0() __attribute__((alias("f0"))); } ``` Pull Request: https://github.com/llvm/llvm-project/pull/87130
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions