summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-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 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<DLLImportAttr>()) {
F->setDLLStorageClass(llvm::GlobalValue::DLLImportStorageClass);