[PATCH] D51288: [MinGW] [X86] Add stubs for references to data variables that might end up imported from a dll

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 29 08:37:38 PDT 2018


rnk added inline comments.


================
Comment at: lib/Target/X86/X86Subtarget.cpp:146
+      !GV->hasDLLImportStorageClass() && GV->hasExternalLinkage() &&
+      GV->isDeclaration() && isa<GlobalVariable>(GV))
+    return X86II::MO_COFFSTUB;
----------------
mstorsjo wrote:
> I guess this condition also should be changed similarly, replacing `GV->hasExternalLinkage() && GV->isDeclaration()` with `GV->isDeclarationForLinker()`? It doesn't seem to change any of the existing testcases here in LLVM though.
I wouldn't expect it to, because by the time we get to codegen we've already discarded all available_externally definitions and turned them into declarations.

I just noticed this is x86-specific logic. Do we need COFF stubs more often on ARM, or can we change shouldAssumeDSOLocal to have this logic for all mingw targets?


https://reviews.llvm.org/D51288





More information about the llvm-commits mailing list