[PATCH] D51382: [MinGW] Don't mark external variables as DSO local

2018-08-29 Thread Martin Storsjö via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC340941: [MinGW] Don't mark external variables as DSO local (authored by mstorsjo, committed by ). Repository: rC Clang https://reviews.llvm.org/D51382 Files: lib/CodeGen/CodeGenModule.cpp test/Cod

[PATCH] D51382: [MinGW] Don't mark external variables as DSO local

2018-08-29 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: test/CodeGen/dso-local-executable.c:14 +// MINGW-DAG: @bar = external global i32 +// MINGW-DAG: @weak_bar = extern_weak global i32 +// MINGW-DAG: declare dso_local void @foo() rnk wrote: > I take it that was a side effe

[PATCH] D51382: [MinGW] Don't mark external variables as DSO local

2018-08-29 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision. rnk added a comment. This revision is now accepted and ready to land. lgtm Comment at: test/CodeGen/dso-local-executable.c:14 +// MINGW-DAG: @bar = external global i32 +// MINGW-DAG: @weak_bar = extern_weak global i32 +// MINGW-DAG: declare dso_local

[PATCH] D51382: [MinGW] Don't mark external variables as DSO local

2018-08-29 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo updated this revision to Diff 163033. mstorsjo added a comment. Changed the condition to GV->isDeclarationForLinker(), updated tests accordingly (weak_bar in CodeGen/dso-local-executable.c lost the dso_local flag) and added more tests in CodeGenCXX/dso-local-executable.cpp as requested.

[PATCH] D51382: [MinGW] Don't mark external variables as DSO local

2018-08-29 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:737 +// potentially could come from another DLL as DSO local. +if (GV->hasExternalLinkage() && GV->isDeclaration() && +isa(GV) && !GV->isThreadLocal()) rnk wrote: > I think

[PATCH] D51382: [MinGW] Don't mark external variables as DSO local

2018-08-28 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:737 +// potentially could come from another DLL as DSO local. +if (GV->hasExternalLinkage() && GV->isDeclaration() && +isa(GV) && !GV->isThreadLocal()) I think this linkage and d

[PATCH] D51382: [MinGW] Don't mark external variables as DSO local

2018-08-28 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. mstorsjo added reviewers: rnk, pcc. Since MinGW supports automatically importing external variables from DLLs even without the DLLImport attribute, we shouldn't mark them as DSO local unless we actually know them to be local for sure. Keep marking thread local va