aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2024-08-04 23:20:45 +0300
committerGitHub <noreply@github.com>2024-08-04 23:20:45 +0300
commit8dd065d5bc81b0c8ab57f365bb169a5d92928f25 (patch)
treea3d60fddd6f8e8b5b29090528f9fbe945eabd4bb /clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
parentfdb9f96fa2a926425bdf8315048db7623d63547d (diff)
downloadllvm-8dd065d5bc81b0c8ab57f365bb169a5d92928f25.zip
llvm-8dd065d5bc81b0c8ab57f365bb169a5d92928f25.tar.gz
llvm-8dd065d5bc81b0c8ab57f365bb169a5d92928f25.tar.bz2
[ARM] [Windows] Use IMAGE_SYM_CLASS_STATIC for private functions (#101828)
For functions with private linkage, pick IMAGE_SYM_CLASS_STATIC rather than IMAGE_SYM_CLASS_EXTERNAL; GlobalValue::isInternalLinkage() only checks for InternalLinkage, while GlobalValue::isLocalLinkage() checks for both InternalLinkage and PrivateLinkage. This matches what the AArch64 target does, since commit 3406934e4db4bf95c230db072608ed062c13ad5b. This activates a preexisting fix for the AArch64 target from 1e7f592a890aad860605cf5220530b3744e107ba, for the ARM target as well. When a relocation points at a symbol, one usually can convey an offset to the symbol by encoding it as an immediate in the instruction. However, for the ARM and AArch64 branch instructions, the immediate stored in the instruction is ignored by MS link.exe (and lld-link matches this aspect). (It would be simple to extend lld-link to support it - but such object files would be incompatible with MS link.exe.) This was worked around by 1e7f592a890aad860605cf5220530b3744e107ba by emitting symbols into the object file symbol table, for temporary symbols that otherwise would have been omitted, if they have the class IMAGE_SYM_CLASS_STATIC, in order to avoid needing an offset in the relocated instruction. This change gives the symbols generated from functions with the IR level "private" linkage the right class, to activate that workaround. This fixes https://github.com/llvm/llvm-project/issues/100101, fixing code generation for coroutines for Windows on ARM. After the change in f78688134026686288a8d310b493d9327753a022, coroutines generate a function with private linkage, and calls to this function were previously broken for this target.
Diffstat (limited to 'clang/lib/Frontend/CreateInvocationFromCommandLine.cpp')
0 files changed, 0 insertions, 0 deletions