From 1be5369a0ce4606d8ee3113ab4372f196d20daeb Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 25 Apr 2019 23:30:41 +0000 Subject: 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 --- clang/lib/CodeGen/CodeGenModule.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index b490fa0faf2e..e51963aa9afc 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()) { F->setDLLStorageClass(llvm::GlobalValue::DLLImportStorageClass); -- cgit v1.2.3