[PATCH] D55627: [ThinLTO] Change locally defined symbols marked dllimport to dllexport
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 13 08:49:47 PST 2018
rnk added a comment.
Why add dllexport instead of just removing dllimport as was done before? This often happens in situations involving inline methods of templates, and I don't think it would be correct to export such inline functions. I also wouldn't want LTO to suddenly export a bunch of things that the native linker wouldn't export. By the way, this situation is covered by the LNK4049 and LNK4217 warnings in the Microsoft linker.
Here's an example of a situation where you might get accidental incorrect imports: https://gcc.godbolt.org/z/VAl5Kn
void g(int);
template <typename T>
struct Foo {
static void f() { g(sizeof(T)); }
};
// Uncomment Bar to see Foo<int>::f get imported
//struct __declspec(dllimport) Bar : Foo<int> {};
void h() { Foo<int>::f(); }
I don't think it would be correct to upgrade Foo<int>::f to dllexport.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55627/new/
https://reviews.llvm.org/D55627
More information about the llvm-commits
mailing list