summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SafeStack.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2017-04-06 20:09:31 +0000
committerMehdi Amini <mehdi.amini@apple.com>2017-04-06 20:09:31 +0000
commit579540a8f7967fdbc8b0bf7cd214a6b12a98a362 (patch)
tree09f39a11e4a7fde5de6cb576bd373684b4870ad7 /llvm/lib/CodeGen/SafeStack.cpp
parent0680968ff3e4971a870932ef0c9ff6f793bdb289 (diff)
downloadbcm5719-llvm-579540a8f7967fdbc8b0bf7cd214a6b12a98a362.tar.gz
bcm5719-llvm-579540a8f7967fdbc8b0bf7cd214a6b12a98a362.zip
Turn some C-style vararg into variadic templates
Module::getOrInsertFunction is using C-style vararg instead of variadic templates. From a user prospective, it forces the use of an annoying nullptr to mark the end of the vararg, and there's not type checking on the arguments. The variadic template is an obvious solution to both issues. Patch by: Serge Guelton <serge.guelton@telecom-bretagne.eu> Differential Revision: https://reviews.llvm.org/D31070 llvm-svn: 299699
Diffstat (limited to 'llvm/lib/CodeGen/SafeStack.cpp')
-rw-r--r--llvm/lib/CodeGen/SafeStack.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SafeStack.cpp b/llvm/lib/CodeGen/SafeStack.cpp
index 2b82df293c1..e6981e82901 100644
--- a/llvm/lib/CodeGen/SafeStack.cpp
+++ b/llvm/lib/CodeGen/SafeStack.cpp
@@ -450,8 +450,8 @@ void SafeStack::checkStackGuard(IRBuilder<> &IRB, Function &F, ReturnInst &RI,
/* Unreachable */ true, Weights);
IRBuilder<> IRBFail(CheckTerm);
// FIXME: respect -fsanitize-trap / -ftrap-function here?
- Constant *StackChkFail = F.getParent()->getOrInsertFunction(
- "__stack_chk_fail", IRB.getVoidTy(), nullptr);
+ Constant *StackChkFail =
+ F.getParent()->getOrInsertFunction("__stack_chk_fail", IRB.getVoidTy());
IRBFail.CreateCall(StackChkFail, {});
}
OpenPOWER on IntegriCloud