move handling of dllimport linkage in isel, not in asmprinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75086 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
index 9d4df93..ad8d6ad 100644
--- a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
+++ b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
@@ -244,11 +244,13 @@
decorateName(Name, GV);
if (!isMemOp) O << "OFFSET ";
- if (GV->hasDLLImportLinkage()) {
- // FIXME: This should be fixed with full support of stdcall & fastcall
- // CC's
+
+ // Handle dllimport linkage.
+ // FIXME: This should be fixed with full support of stdcall & fastcall
+ // CC's
+ if (MO.getTargetFlags() == X86II::MO_DLLIMPORT)
O << "__imp_";
- }
+
O << Name;
printOffset(MO.getOffset());
return;
@@ -278,11 +280,11 @@
std::string Name = Mang->getValueName(GV);
decorateName(Name, GV);
- if (GV->hasDLLImportLinkage()) {
- // FIXME: This should be fixed with full support of stdcall & fastcall
- // CC's
+ // Handle dllimport linkage.
+ // FIXME: This should be fixed with full support of stdcall & fastcall
+ // CC's
+ if (MO.getTargetFlags() == X86II::MO_DLLIMPORT)
O << "__imp_";
- }
O << Name;
printOffset(MO.getOffset());
return;