diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2018-03-22 18:03:13 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2018-03-22 18:03:13 +0000 |
commit | 1193c370b4b2ba671e95ae4df20d79068e231398 (patch) | |
tree | 661b9aadbe1ca7477621faa28f6c6e14ce153757 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 0164d11b04c6f832176382e59402188bc482aba7 (diff) | |
download | bcm5719-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.cpp | 8 |
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 |