From 1193c370b4b2ba671e95ae4df20d79068e231398 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 22 Mar 2018 18:03:13 +0000 Subject: Set dso_local on builtin functions. The difference between CreateRuntimeFunction and CreateBuiltinFunction is that CreateBuiltinFunction would not set dllimport or dso_local. To keep the current semantics, just forward to CreateRuntimeFunction with Local=true so it doesn't add dllimport. llvm-svn: 328224 --- clang/lib/CodeGen/CodeGenModule.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index e7efd410dbf8..2748dc342269 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -2640,13 +2640,7 @@ CodeGenModule::CreateRuntimeFunction(llvm::FunctionType *FTy, StringRef Name, llvm::Constant * CodeGenModule::CreateBuiltinFunction(llvm::FunctionType *FTy, StringRef Name, llvm::AttributeList ExtraAttrs) { - llvm::Constant *C = - GetOrCreateLLVMFunction(Name, FTy, GlobalDecl(), /*ForVTable=*/false, - /*DontDefer=*/false, /*IsThunk=*/false, ExtraAttrs); - if (auto *F = dyn_cast(C)) - if (F->empty()) - F->setCallingConv(getRuntimeCC()); - return C; + return CreateRuntimeFunction(FTy, Name, ExtraAttrs, true); } /// isTypeConstant - Determine whether an object of this type can be emitted -- cgit v1.2.3