From 7976eb58382b25d0e17490b9d77fb06cb000c95b Mon Sep 17 00:00:00 2001 From: James Y Knight Date: Fri, 1 Feb 2019 20:43:25 +0000 Subject: [opaque pointer types] Pass function types to CallInst creation. This cleans up all CallInst creation in LLVM to explicitly pass a function type rather than deriving it from the pointer's element-type. Differential Revision: https://reviews.llvm.org/D57170 llvm-svn: 352909 --- llvm/lib/CodeGen/StackProtector.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen/StackProtector.cpp') diff --git a/llvm/lib/CodeGen/StackProtector.cpp b/llvm/lib/CodeGen/StackProtector.cpp index e7be79e8ecb..94f74b05aff 100644 --- a/llvm/lib/CodeGen/StackProtector.cpp +++ b/llvm/lib/CodeGen/StackProtector.cpp @@ -413,15 +413,14 @@ bool StackProtector::InsertStackProtectors() { // Generate epilogue instrumentation. The epilogue intrumentation can be // function-based or inlined depending on which mechanism the target is // providing. - if (Value* GuardCheck = TLI->getSSPStackGuardCheck(*M)) { + if (Function *GuardCheck = TLI->getSSPStackGuardCheck(*M)) { // Generate the function-based epilogue instrumentation. // The target provides a guard check function, generate a call to it. IRBuilder<> B(RI); LoadInst *Guard = B.CreateLoad(AI, true, "Guard"); CallInst *Call = B.CreateCall(GuardCheck, {Guard}); - llvm::Function *Function = cast(GuardCheck); - Call->setAttributes(Function->getAttributes()); - Call->setCallingConv(Function->getCallingConv()); + Call->setAttributes(GuardCheck->getAttributes()); + Call->setCallingConv(GuardCheck->getCallingConv()); } else { // Generate the epilogue with inline instrumentation. // If we do not support SelectionDAG based tail calls, generate IR level -- cgit v1.2.3