summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2011-02-21 04:50:06 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2011-02-21 04:50:06 +0000
commit860abd0f28f9a9fe7d2875e47788644b2fe1bb31 (patch)
tree2c097b6437f0f4c80e37f5ddbc1cf054ad468403 /llvm/lib/Target
parenta82203f8757e617f26b9c4196c10ba0063c76a03 (diff)
downloadbcm5719-llvm-860abd0f28f9a9fe7d2875e47788644b2fe1bb31.tar.gz
bcm5719-llvm-860abd0f28f9a9fe7d2875e47788644b2fe1bb31.zip
Target/X86/X86FastISel: [PR6275] Fix Win32's dllimport function with fastisel.
"dllimport" function must not be GlobalVariable, but Function. It is enough to check with GlobalValue. test/CodeGen/X86/dll-linkage.ll is updated to check llc -O0. llvm-svn: 126110
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/X86/X86FastISel.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86FastISel.cpp b/llvm/lib/Target/X86/X86FastISel.cpp
index 9d42ac2e470..6fa928462b2 100644
--- a/llvm/lib/Target/X86/X86FastISel.cpp
+++ b/llvm/lib/Target/X86/X86FastISel.cpp
@@ -597,9 +597,13 @@ bool X86FastISel::X86SelectCallAddress(const Value *V, X86AddressMode &AM) {
(AM.Base.Reg != 0 || AM.IndexReg != 0))
return false;
- // Can't handle TLS or DLLImport.
+ // Can't handle DLLImport.
+ if (GV->hasDLLImportLinkage())
+ return false;
+
+ // Can't handle TLS.
if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV))
- if (GVar->isThreadLocal() || GVar->hasDLLImportLinkage())
+ if (GVar->isThreadLocal())
return false;
// Okay, we've committed to selecting this global. Set up the basic address.
OpenPOWER on IntegriCloud