aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/TargetMachine.cpp
diff options
context:
space:
mode:
author王宇逸 <Strawberry_Str@hotmail.com>2025-01-03 07:08:58 +0900
committerGitHub <noreply@github.com>2025-01-03 00:08:58 +0200
commitf03b100e93196ca1ecec20fde3fc48690b3dad7e (patch)
tree12034bc452d750498f8e59b2956d5d2481770db1 /llvm/lib/Target/TargetMachine.cpp
parent4922350407127607a9e78fc6d19f3f6278b1e46b (diff)
downloadllvm-f03b100e93196ca1ecec20fde3fc48690b3dad7e.zip
llvm-f03b100e93196ca1ecec20fde3fc48690b3dad7e.tar.gz
llvm-f03b100e93196ca1ecec20fde3fc48690b3dad7e.tar.bz2
[Cygwin] Fix global variable dll import (#121439)
This PR is necessary for cygwin target of Rust. References: * https://github.com/rust-lang/llvm-project/commit/86657cc39f8e42ae73be810fb0703ddac0eeef94 * https://github.com/Berrysoft/llvm-project/commit/a807e9f077351d3c6a68f4abe74c94a039759a2e
Diffstat (limited to 'llvm/lib/Target/TargetMachine.cpp')
-rw-r--r--llvm/lib/Target/TargetMachine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp
index c0985f3..d5365f3 100644
--- a/llvm/lib/Target/TargetMachine.cpp
+++ b/llvm/lib/Target/TargetMachine.cpp
@@ -204,7 +204,7 @@ bool TargetMachine::shouldAssumeDSOLocal(const GlobalValue *GV) const {
// don't assume the variables to be DSO local unless we actually know
// that for sure. This only has to be done for variables; for functions
// the linker can insert thunks for calling functions from another DLL.
- if (TT.isWindowsGNUEnvironment() && GV->isDeclarationForLinker() &&
+ if (TT.isOSCygMing() && GV->isDeclarationForLinker() &&
isa<GlobalVariable>(GV))
return false;