summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2019-04-25 23:30:41 +0000
committerReid Kleckner <rnk@google.com>2019-04-25 23:30:41 +0000
commit1be5369a0ce4606d8ee3113ab4372f196d20daeb (patch)
treee4beba1dfaaf42653b533ec99f635dc872417412 /clang/lib/CodeGen
parent4730604bd3a361c68b92b18bf73a5daa15afe9f4 (diff)
downloadbcm5719-llvm-1be5369a0ce4606d8ee3113ab4372f196d20daeb.tar.gz
bcm5719-llvm-1be5369a0ce4606d8ee3113ab4372f196d20daeb.zip
Revert [COFF] Statically link certain runtime library functions
This reverts r359250 (git commit 4730604bd3a361c68b92b18bf73a5daa15afe9f4) The newly added test should use -cc1 and -emit-llvm and there are other test failures that need fixing. llvm-svn: 359251
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index b490fa0faf2..e51963aa9af 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -3000,13 +3000,9 @@ CodeGenModule::CreateRuntimeFunction(llvm::FunctionType *FTy, StringRef Name,
if (F->empty()) {
F->setCallingConv(getRuntimeCC());
- // In Windows Itanium environments, try to mark runtime functions
- // dllimport. For Mingw and MSVC, don't. We don't really know if the user
- // will link their standard library statically or dynamically. Marking
- // functions imported when they are not imported can cause linker errors
- // and warnings.
- if (!Local && getTriple().isWindowsItaniumEnvironment() &&
- !getCodeGenOpts().LTOVisibilityPublicStd) {
+ if (!Local && getTriple().isOSBinFormatCOFF() &&
+ !getCodeGenOpts().LTOVisibilityPublicStd &&
+ !getTriple().isWindowsGNUEnvironment()) {
const FunctionDecl *FD = GetRuntimeFunctionDecl(Context, Name);
if (!FD || FD->hasAttr<DLLImportAttr>()) {
F->setDLLStorageClass(llvm::GlobalValue::DLLImportStorageClass);
OpenPOWER on IntegriCloud