diff options
Diffstat (limited to 'llvm/lib/CodeGen/SafeStack.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SafeStack.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SafeStack.cpp b/llvm/lib/CodeGen/SafeStack.cpp index a6c1a76..9962070 100644 --- a/llvm/lib/CodeGen/SafeStack.cpp +++ b/llvm/lib/CodeGen/SafeStack.cpp @@ -799,8 +799,16 @@ bool SafeStack::run() { IRB.SetCurrentDebugLocation( DILocation::get(SP->getContext(), SP->getScopeLine(), 0, SP)); if (SafeStackUsePointerAddress) { + const char *SafestackPointerAddressName = + TL.getLibcallName(RTLIB::SAFESTACK_POINTER_ADDRESS); + if (!SafestackPointerAddressName) { + F.getContext().emitError( + "no libcall available for safestack pointer address"); + return false; + } + FunctionCallee Fn = F.getParent()->getOrInsertFunction( - "__safestack_pointer_address", IRB.getPtrTy(0)); + SafestackPointerAddressName, IRB.getPtrTy(0)); UnsafeStackPtr = IRB.CreateCall(Fn); } else { UnsafeStackPtr = TL.getSafeStackPointerLocation(IRB); |