summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
diff options
context:
space:
mode:
authorSerge Guelton <sguelton@quarkslab.com>2017-04-11 08:36:52 +0000
committerSerge Guelton <sguelton@quarkslab.com>2017-04-11 08:36:52 +0000
commit5fd75fb72e0eb04bf590765fc70f27a444993e74 (patch)
tree84129b3eeea29bf385a524a5f3775c7323612619 /llvm/lib/Transforms/IPO
parent06faa9bf329e1386f9fc8a5dee55be6027d1d6d0 (diff)
downloadbcm5719-llvm-5fd75fb72e0eb04bf590765fc70f27a444993e74.tar.gz
bcm5719-llvm-5fd75fb72e0eb04bf590765fc70f27a444993e74.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. llvm-svn: 299925
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r--llvm/lib/Transforms/IPO/CrossDSOCFI.cpp4
-rw-r--r--llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp2
2 files changed, 3 insertions, 3 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);
diff --git a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
index 2579528f54d..cb7d487b68b 100644
--- a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
+++ b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
@@ -1221,7 +1221,7 @@ void DevirtModule::importResolution(VTableSlot Slot, VTableSlotInfo &SlotInfo) {
// The type of the function in the declaration is irrelevant because every
// call site will cast it to the correct type.
auto *SingleImpl = M.getOrInsertFunction(
- Res.SingleImplName, Type::getVoidTy(M.getContext()), nullptr);
+ Res.SingleImplName, Type::getVoidTy(M.getContext()));
// This is the import phase so we should not be exporting anything.
bool IsExported = false;
OpenPOWER on IntegriCloud