summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2018-03-22 18:03:13 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2018-03-22 18:03:13 +0000
commit1193c370b4b2ba671e95ae4df20d79068e231398 (patch)
tree661b9aadbe1ca7477621faa28f6c6e14ce153757 /clang/lib/CodeGen/CodeGenModule.cpp
parent0164d11b04c6f832176382e59402188bc482aba7 (diff)
downloadbcm5719-llvm-1193c370b4b2ba671e95ae4df20d79068e231398.tar.gz
bcm5719-llvm-1193c370b4b2ba671e95ae4df20d79068e231398.zip
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index e7efd410dbf..2748dc34226 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<llvm::Function>(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
OpenPOWER on IntegriCloud