diff options
author | Serge Guelton <sguelton@quarkslab.com> | 2017-04-11 15:01:18 +0000 |
---|---|---|
committer | Serge Guelton <sguelton@quarkslab.com> | 2017-04-11 15:01:18 +0000 |
commit | 59a2d7b9093617aff6b6f147ba267bc788aa08b7 (patch) | |
tree | 2ffc9141cd19edf0d123828627a9f1e8c4c19907 /llvm/lib/Transforms/IPO/CrossDSOCFI.cpp | |
parent | de3b9a2ecc7e9ebe3fc1780aede0223821c52d2a (diff) | |
download | bcm5719-llvm-59a2d7b9093617aff6b6f147ba267bc788aa08b7.tar.gz bcm5719-llvm-59a2d7b9093617aff6b6f147ba267bc788aa08b7.zip |
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.
Differential Revision: https://reviews.llvm.org/D31070
llvm-svn: 299949
Diffstat (limited to 'llvm/lib/Transforms/IPO/CrossDSOCFI.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/CrossDSOCFI.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/CrossDSOCFI.cpp b/llvm/lib/Transforms/IPO/CrossDSOCFI.cpp index e8738e70257..1b111de0615 100644 --- a/llvm/lib/Transforms/IPO/CrossDSOCFI.cpp +++ b/llvm/lib/Transforms/IPO/CrossDSOCFI.cpp @@ -98,7 +98,7 @@ void CrossDSOCFI::buildCFICheck(Module &M) { LLVMContext &Ctx = M.getContext(); Constant *C = M.getOrInsertFunction( "__cfi_check", Type::getVoidTy(Ctx), Type::getInt64Ty(Ctx), - Type::getInt8PtrTy(Ctx), Type::getInt8PtrTy(Ctx), nullptr); + Type::getInt8PtrTy(Ctx), Type::getInt8PtrTy(Ctx)); Function *F = dyn_cast<Function>(C); // Take over the existing function. The frontend emits a weak stub so that the // linker knows about the symbol; this pass replaces the function body. @@ -120,7 +120,7 @@ void CrossDSOCFI::buildCFICheck(Module &M) { IRBuilder<> IRBFail(TrapBB); Constant *CFICheckFailFn = M.getOrInsertFunction( "__cfi_check_fail", Type::getVoidTy(Ctx), Type::getInt8PtrTy(Ctx), - Type::getInt8PtrTy(Ctx), nullptr); + Type::getInt8PtrTy(Ctx)); IRBFail.CreateCall(CFICheckFailFn, {&CFICheckFailData, &Addr}); IRBFail.CreateBr(ExitBB); |